mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Establish tests for the utilities app
This commit is contained in:
13
netbox/utilities/testing.py
Normal file
13
netbox/utilities/testing.py
Normal file
@ -0,0 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
class HttpStatusMixin(object):
|
||||
"""
|
||||
Custom mixin to provide more detail in the event of an unexpected HTTP response.
|
||||
"""
|
||||
|
||||
def assertHttpStatus(self, response, expected_status):
|
||||
err_message = "Expected HTTP status {}; received {}: {}"
|
||||
self.assertEqual(response.status_code, expected_status, err_message.format(
|
||||
expected_status, response.status_code, response.data
|
||||
))
|
Reference in New Issue
Block a user