Revision a01eb018
b/snf-astakos-app/astakos/api/tokens.py | ||
---|---|---|
87 | 87 |
if user.uuid != uuid: |
88 | 88 |
raise faults.Unauthorized('Invalid credentials') |
89 | 89 |
|
90 |
if tenant is not None:
|
|
90 |
if tenant: |
|
91 | 91 |
if user.uuid != tenant: |
92 | 92 |
raise faults.BadRequest('Not conforming tenantName') |
93 | 93 |
|
b/snf-astakos-app/astakos/im/tests/api.py | ||
---|---|---|
542 | 542 |
self.assertEqual(body['badRequest']['message'], |
543 | 543 |
'Not conforming tenantName') |
544 | 544 |
|
545 |
# Check bad request: inconsistent tenant |
|
546 |
url = reverse('astakos.api.tokens.authenticate') |
|
547 |
post_data = """{"auth":{"token":{"id":"%s"}, |
|
548 |
"tenantName":""}}""" % ( |
|
549 |
self.user1.auth_token) |
|
550 |
r = client.post(url, post_data, content_type='application/json') |
|
551 |
self.assertEqual(r.status_code, 200) |
|
552 |
|
|
545 | 553 |
# Check successful json response |
546 | 554 |
url = reverse('astakos.api.tokens.authenticate') |
547 | 555 |
post_data = """{"auth":{"passwordCredentials":{"username":"%s", |
Also available in: Unified diff