X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=blobdiff_plain;f=apps%2Fpatchwork%2Ftests%2Fpatchparser.py;fp=apps%2Fpatchwork%2Ftests%2Fpatchparser.py;h=351843259b69ab8c84012c817f349b282e55f381;hp=e508dc08a9beffcf376d5f3bb28baa84a76d44ad;hb=d45218b2e3894211e11313820bea9f59677c4bf2;hpb=64b4f583066dc0757a82257d1dd2c97d451ce7d4 diff --git a/apps/patchwork/tests/patchparser.py b/apps/patchwork/tests/patchparser.py index e508dc0..3518432 100644 --- a/apps/patchwork/tests/patchparser.py +++ b/apps/patchwork/tests/patchparser.py @@ -83,6 +83,17 @@ class UTF8InlinePatchTest(InlinePatchTest): content_encoding = self.patch_encoding) (self.patch, self.comment) = find_content(self.project, email) +class NoCharsetInlinePatchTest(InlinePatchTest): + """ Test mails with no content-type or content-encoding header """ + patch_filename = '0001-add-line.patch' + + def setUp(self): + self.orig_patch = read_patch(self.patch_filename) + email = create_email(self.test_comment + '\n' + self.orig_patch) + del email['Content-Type'] + del email['Content-Transfer-Encoding'] + (self.patch, self.comment) = find_content(self.project, email) + class SignatureCommentTest(InlinePatchTest): patch_filename = '0001-add-line.patch' test_comment = 'Test comment\nmore comment'