mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 09:58:06 +00:00
assert_json_error_contains: Support passing a status code.
Previously this test helper function hardcoded 400.
This commit is contained in:
@@ -327,8 +327,8 @@ class AuthedTestCase(TestCase):
|
|||||||
return self.assertTrue(actual_count <= count,
|
return self.assertTrue(actual_count <= count,
|
||||||
"len(%s) == %s, > %s" % (queries, actual_count, count))
|
"len(%s) == %s, > %s" % (queries, actual_count, count))
|
||||||
|
|
||||||
def assert_json_error_contains(self, result, msg_substring):
|
def assert_json_error_contains(self, result, msg_substring, status_code=400):
|
||||||
self.assertIn(msg_substring, self.get_json_error(result))
|
self.assertIn(msg_substring, self.get_json_error(result, status_code=status_code))
|
||||||
|
|
||||||
def fixture_data(self, type, action, file_type='json'):
|
def fixture_data(self, type, action, file_type='json'):
|
||||||
return open(os.path.join(os.path.dirname(__file__),
|
return open(os.path.join(os.path.dirname(__file__),
|
||||||
|
|||||||
Reference in New Issue
Block a user