Revision d29f0371 snf-astakos-app/astakos/im/tests/api.py
b/snf-astakos-app/astakos/im/tests/api.py | ||
---|---|---|
426 | 426 |
r = client.get(url, post_data={}) |
427 | 427 |
self.assertEqual(r.status_code, 400) |
428 | 428 |
|
429 |
# Malformed request |
|
430 |
url = reverse('astakos.api.tokens.authenticate') |
|
431 |
r = client.post(url, post_data={}) |
|
432 |
self.assertEqual(r.status_code, 400) |
|
429 |
# check public mode |
|
430 |
r = client.post(url, CONTENT_LENGTH=0) |
|
431 |
self.assertEqual(r.status_code, 200) |
|
432 |
self.assertTrue(r['Content-Type'].startswith('application/json')) |
|
433 |
try: |
|
434 |
body = json.loads(r.content) |
|
435 |
except Exception, e: |
|
436 |
self.fail(e) |
|
437 |
self.assertTrue('token' not in body.get('access')) |
|
438 |
self.assertTrue('user' not in body.get('access')) |
|
439 |
self.assertTrue('serviceCatalog' in body.get('access')) |
|
433 | 440 |
|
434 | 441 |
# Check unsupported xml input |
435 | 442 |
url = reverse('astakos.api.tokens.authenticate') |
... | ... | |
553 | 560 |
# body = minidom.parseString(r.content) |
554 | 561 |
# except Exception, e: |
555 | 562 |
# self.fail(e) |
563 |
|
|
564 |
# test public mode: json response |
Also available in: Unified diff