Revision b3fd98ae snf-cyclades-app/synnefo/api/tests.py
b/snf-cyclades-app/synnefo/api/tests.py | ||
---|---|---|
50 | 50 |
.... make api calls .... |
51 | 51 |
|
52 | 52 |
""" |
53 |
def dummy_get_user(request, *args, **kwargs): |
|
54 |
request.user = {'username': user, 'groups': []} |
|
55 |
request.user_uniq = user |
|
56 |
|
|
57 |
with patch('synnefo.api.util.get_user') as m: |
|
58 |
m.side_effect = dummy_get_user |
|
59 |
yield |
|
53 |
with patch("snf_django.lib.api.get_token") as get_token: |
|
54 |
get_token.return_value = "DummyToken" |
|
55 |
with patch('astakosclient.AstakosClient.get_user_info') as m: |
|
56 |
m.return_value = {"uuid": user} |
|
57 |
yield |
|
60 | 58 |
|
61 | 59 |
|
62 | 60 |
class BaseAPITest(TestCase): |
Also available in: Unified diff