Revision aa519091 api/tests.py
b/api/tests.py | ||
---|---|---|
741 | 741 |
fixtures = ['api_test_data', 'auth_test_data'] |
742 | 742 |
apibase = '/api/v1.1' |
743 | 743 |
|
744 |
def setUp(self): |
|
745 |
self.client = Client() |
|
744 | 746 |
|
745 | 747 |
def test_auth_cookie(self): |
746 | 748 |
user = SynnefoUser.objects.get(uniq = "test@synnefo.gr") |
... | ... | |
773 | 775 |
self.assertEquals(response['X-Server-Management-Url'], '') |
774 | 776 |
self.assertEquals(response['X-Storage-Url'], '') |
775 | 777 |
self.assertEquals(response['X-CDN-Management-Url'], '') |
778 |
|
|
779 |
def test_unauthorized_call(self): |
|
780 |
request = {'reboot': {'type': 'HARD'}} |
|
781 |
path = '/api/v1.1/servers/%d/action' % 1 |
|
782 |
response = self.client.post(path, json.dumps(request), content_type='application/json') |
|
783 |
self.assertEquals(response.status_code, 401) |
Also available in: Unified diff