diff --git a/kalite/testing/mixins/browser_mixins.py b/kalite/testing/mixins/browser_mixins.py index 9a2a3ac0d4..df9a78b5c1 100644 --- a/kalite/testing/mixins/browser_mixins.py +++ b/kalite/testing/mixins/browser_mixins.py @@ -127,7 +127,11 @@ def browser_check_django_message(self, message_type=None, contains=None, exact=N if num_messages is not None: msg = "Make sure there are %d message(s), type='%s'." % \ (num_messages, message_type if message_type else "(any)") - self.assertEqual(num_messages, len(messages), msg) + try: + self.assertEqual(num_messages, len(messages), msg) + except AssertionError: + print("Wrong number of matching messages found in:\n{}".format("\n".join(messages))) + raise for i, message in enumerate(messages): if type(contains) == list: