From 3d4020fd1ca33ba5704f509f042857f220ce2e6e Mon Sep 17 00:00:00 2001 From: "K.Kanakhin" Date: Mon, 10 Apr 2017 16:35:56 +0600 Subject: [PATCH] tests: Add AssertNotIn helper to the base test class. --- zerver/lib/test_classes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py index 490424839f..71262bb111 100644 --- a/zerver/lib/test_classes.py +++ b/zerver/lib/test_classes.py @@ -378,6 +378,13 @@ class ZulipTestCase(TestCase): for substring in substrings: self.assertIn(substring, decoded) + def assert_not_in_success_response(self, substrings, response): + # type: (List[Text], HttpResponse) -> None + self.assertEqual(response.status_code, 200) + decoded = response.content.decode('utf-8') + for substring in substrings: + self.assertNotIn(substring, decoded) + def fixture_data(self, type, action, file_type='json'): # type: (Text, Text, Text) -> Text return force_text(open(os.path.join(os.path.dirname(__file__),