X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=patchwork%2Ftests%2Ftest_patchparser.py;fp=patchwork%2Ftests%2Ftest_patchparser.py;h=5eefeb5092572bc8cc348695f53c4c7b282a1354;hb=3b8a61c68fa61eadebf7b19329e8d3bffde9e6b4;hp=119936acab1e44519f0e32afa970ebb3cbb0361a;hpb=daa3ae42eee5e569881070bcc2958b361743f70a;p=patchwork diff --git a/patchwork/tests/test_patchparser.py b/patchwork/tests/test_patchparser.py index 119936a..5eefeb5 100644 --- a/patchwork/tests/test_patchparser.py +++ b/patchwork/tests/test_patchparser.py @@ -552,3 +552,30 @@ class InitialPatchStateTest(TestCase): def tearDown(self): self.p1.delete() self.user.delete() + +class ParseInitialTagsTest(PatchTest): + patch_filename = '0001-add-line.patch' + test_comment = ('test comment\n\n' + + 'Tested-by: Test User \n' + + 'Reviewed-by: Test User \n') + fixtures = ['default_tags'] + + def setUp(self): + project = defaults.project + project.listid = 'test.example.com' + project.save() + self.orig_patch = read_patch(self.patch_filename) + email = create_email(self.test_comment + '\n' + self.orig_patch, + project = project) + email['Message-Id'] = '<1@example.com>' + parse_mail(email) + + def testTags(self): + self.assertEquals(Patch.objects.count(), 1) + patch = Patch.objects.all()[0] + self.assertEquals(patch.patchtag_set.filter( + tag__name='Acked-by').count(), 0) + self.assertEquals(patch.patchtag_set.get( + tag__name='Reviewed-by').count, 1) + self.assertEquals(patch.patchtag_set.get( + tag__name='Tested-by').count, 1)