diff --git a/zerver/tests/test_bugdown.py b/zerver/tests/test_bugdown.py index 251955dac7..6eae5d1835 100644 --- a/zerver/tests/test_bugdown.py +++ b/zerver/tests/test_bugdown.py @@ -343,6 +343,15 @@ class BugdownTest(TestCase): self.assertEqual(converted, '

We should fix #224 and #115, but not issue#124 or #1124z or trac #15 today.

') self.assertEqual(converted_subject, [u'https://trac.zulip.net/ticket/444']) + def test_realm_patterns_negative(self): + realm = get_realm('zulip.com') + RealmFilter(realm=realm, pattern=r"#(?P[0-9]{2,8})", + url_format_string=r"https://trac.zulip.net/ticket/%(id)s").save() + boring_msg = Message(sender=get_user_profile_by_email("othello@zulip.com"), + subject=u"no match here") + converted_boring_subject = bugdown.subject_links(realm.domain.lower(), boring_msg.subject) + self.assertEqual(converted_boring_subject, []) + def test_stream_subscribe_button_simple(self): msg = '!_stream_subscribe_button(simple)' converted = bugdown_convert(msg)