diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2012-05-01 15:51:38 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2012-05-01 15:53:32 +0800 |
commit | 59ddd051801cf70c7841686ec2b45af523d0050e (patch) | |
tree | f6efb72e3fe8f8ee5b163e73907ef27c62ee2bc5 | |
parent | 18986b7edf33b22e6bf3b4023dfcc12a0c78fb65 (diff) | |
download | patchwork-59ddd051801cf70c7841686ec2b45af523d0050e.tar patchwork-59ddd051801cf70c7841686ec2b45af523d0050e.tar.gz |
tests/notifications: Add test for escaped patch names
.. to test for the fix introduced in 18986b7e.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | apps/patchwork/tests/notifications.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/patchwork/tests/notifications.py b/apps/patchwork/tests/notifications.py index f14b30b..df7e3f9 100644 --- a/apps/patchwork/tests/notifications.py +++ b/apps/patchwork/tests/notifications.py @@ -172,6 +172,20 @@ class PatchNotificationEmailTest(TestCase): self.assertEquals(msg.to, [self.submitter.email]) self.assertTrue(self.patch.get_absolute_url() in msg.body) + def testNotificationEscaping(self): + self.patch.name = 'Patch name with " character' + self.patch.save() + PatchChangeNotification(patch = self.patch, + orig_state = self.patch.state).save() + self._expireNotifications() + + errors = send_notifications() + self.assertEquals(errors, []) + self.assertEquals(len(mail.outbox), 1) + msg = mail.outbox[0] + self.assertEquals(msg.to, [self.submitter.email]) + self.assertFalse('"' in msg.body) + def testNotificationOptout(self): """ensure opt-out addresses don't get notifications""" PatchChangeNotification(patch = self.patch, |