Skip to content

Commit 96e67e7

Browse files
committed
ref(controller-tests): add status_code assertion and detailed message
1 parent 42966f5 commit 96e67e7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

controller/api/tests/test_perm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ def test_create(self):
162162
for model in ['builds', 'config', 'containers', 'limits', 'releases']:
163163
response = self.client.get("/v1/apps/{}/{}/".format(app_id, model),
164164
HTTP_AUTHORIZATION='token {}'.format(self.token2))
165-
self.assertEqual(response.data['detail'], 'Not found')
165+
msg = "Failed: status '%s', and data '%s'" % (response.status_code, response.data)
166+
self.assertEqual(response.status_code, 404, msg=msg)
167+
self.assertEqual(response.data['detail'], 'Not found', msg=msg)
166168
# TODO: test that git pushing to the app fails
167169
# give user 2 permission to user 1's app
168170
url = "/v1/apps/{}/perms".format(app_id)

0 commit comments

Comments
 (0)