]> git.ozlabs.org Git - patchwork/commitdiff
tests/utils: Fix List-Id headers on emails from create_email
authorJeremy Kerr <jk@ozlabs.org>
Tue, 3 Jun 2014 13:15:42 +0000 (21:15 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 3 Jun 2014 13:18:29 +0000 (21:18 +0800)
We need to use the project's List Id in the List-Id header, not the
linkname.

We'll also need to populate the .listid member of defaults.project.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/tests/utils.py

index 3f57bafd2aad44dafbbcf1ee4af8edd69c4acb3a..c36b6c12555b90f8c03f63f35e9bd2c5d76fd172 100644 (file)
@@ -37,7 +37,8 @@ _test_mail_dir  = os.path.join(os.path.dirname(__file__), 'mail')
 _test_patch_dir = os.path.join(os.path.dirname(__file__), 'patches')
 
 class defaults(object):
-    project = Project(linkname = 'test-project', name = 'Test Project')
+    project = Project(linkname = 'test-project', name = 'Test Project',
+                      listid = 'test.example.com')
 
     patch_author = 'Patch Author <patch-author@example.com>'
     patch_author_person = Person(name = 'Patch Author',
@@ -131,7 +132,7 @@ def create_email(content, subject = None, sender = None, multipart = False,
 
     msg['Subject'] = subject
     msg['From'] = sender
-    msg['List-Id'] = project.linkname
+    msg['List-Id'] = project.listid
 
 
     return msg