mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Use assertHttpStatus() when evaluating HTTP response status
This commit is contained in:
@ -20,7 +20,7 @@ class APITestCase(_APITestCase):
|
||||
"""
|
||||
err_message = "Expected HTTP status {}; received {}: {}"
|
||||
self.assertEqual(response.status_code, expected_status, err_message.format(
|
||||
expected_status, response.status_code, response.data
|
||||
expected_status, response.status_code, getattr(response, 'data', 'No data')
|
||||
))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user