mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +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,
|
||||
"len(%s) == %s, > %s" % (queries, actual_count, count))
|
||||
|
||||
def assert_json_error_contains(self, result, msg_substring):
|
||||
self.assertIn(msg_substring, self.get_json_error(result))
|
||||
def assert_json_error_contains(self, result, msg_substring, status_code=400):
|
||||
self.assertIn(msg_substring, self.get_json_error(result, status_code=status_code))
|
||||
|
||||
def fixture_data(self, type, action, file_type='json'):
|
||||
return open(os.path.join(os.path.dirname(__file__),
|
||||
|
||||
Reference in New Issue
Block a user