summaryrefslogtreecommitdiff
path: root/tests/test_import_emails.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_import_emails.py')
-rw-r--r--tests/test_import_emails.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_import_emails.py b/tests/test_import_emails.py
index fd4a8a3..4846bfa 100644
--- a/tests/test_import_emails.py
+++ b/tests/test_import_emails.py
@@ -169,3 +169,17 @@ class TestImportEmail(TestCase):
self.assertEqual(1, Patch.objects.all().count())
tcs = [x.team for x in TeamCredit.objects.all()]
self.assertEqual(teams, tcs)
+
+ @mock.patch('linaro_metrics.parsemail.Crowd')
+ def test_monkey_patch_no_listid(self, crowd):
+ Project.objects.all().delete()
+ qemu = Project.objects.create(
+ name='qemu-devel', linkname='qemu-devel',
+ listemail='qemu-devel@nongnu.org', listid='qemu-devel.nongnu.org')
+
+ crowd().get_user_no_cache.return_value = {'display-name': 'User Name'}
+
+ with import_emails.get_monkey_patcher()(import_emails.parsemail):
+ self._import_patch('no-list-id.mbox')
+ self.assertEqual(1, Patch.objects.all().count())
+ self.assertEqual(qemu, Patch.objects.all()[0].project)