aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patchwork/models.py2
-rw-r--r--patchwork/tests/test_mboxviews.py28
2 files changed, 21 insertions, 9 deletions
diff --git a/patchwork/models.py b/patchwork/models.py
index 11886f1..3bf7c72 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -317,7 +317,7 @@ class EmailMixin(models.Model):
content = models.TextField(null=True, blank=True)
response_re = re.compile(
- r'^(Tested|Reviewed|Acked|Signed-off|Nacked|Reported)-by: .*$',
+ r'^(Tested|Reviewed|Acked|Signed-off|Nacked|Reported)-by:.*$',
re.M | re.I)
@property
diff --git a/patchwork/tests/test_mboxviews.py b/patchwork/tests/test_mboxviews.py
index 0dc4abb..2d6cdc3 100644
--- a/patchwork/tests/test_mboxviews.py
+++ b/patchwork/tests/test_mboxviews.py
@@ -39,21 +39,33 @@ class MboxPatchResponseTest(TestCase):
"""Test that the mbox view appends the Acked-by from a patch comment."""
def setUp(self):
- project = create_project()
+ self.project = create_project()
self.person = create_person()
- self.patch = create_patch(
- project=project,
+
+ def test_patch_response(self):
+ patch = create_patch(
+ project=self.project,
submitter=self.person,
content='comment 1 text\nAcked-by: 1\n')
- self.comment = create_comment(
- submission=self.patch,
+ create_comment(
+ submission=patch,
submitter=self.person,
content='comment 2 text\nAcked-by: 2\n')
-
- def test_patch_response(self):
- response = self.client.get(reverse('patch-mbox', args=[self.patch.id]))
+ response = self.client.get(reverse('patch-mbox', args=[patch.id]))
self.assertContains(response, 'Acked-by: 1\nAcked-by: 2\n')
+ def test_patch_utf8_nbsp(self):
+ patch = create_patch(
+ project=self.project,
+ submitter=self.person,
+ content='patch text\n')
+ create_comment(
+ submission=patch,
+ submitter=self.person,
+ content=u'comment\nAcked-by:\u00A0 foo')
+ response = self.client.get(reverse('patch-mbox', args=[patch.id]))
+ self.assertContains(response, u'\u00A0 foo\n')
+
class MboxPatchSplitResponseTest(TestCase):