1
0
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:
Jeremy Stretch
2018-06-08 14:32:41 -04:00
parent 33add12069
commit e4f336a843
11 changed files with 8 additions and 8 deletions

View 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
))