@@ -697,6 +697,37 @@ def testNewIssueNoAuthorEmail(self):
697697This is a file containing text
698698in latin-1 format =E4=F6=FC=C4=D6=DC=DF
699699
700+ --uh56ypi7view24rr--
701+ '''
702+
703+ filename_msg = '''From: mary <[email protected] > 704+ 705+ Message-Id: <followup_dummy_id>
706+ In-Reply-To: <dummy_test_message_id>
707+ Subject: [issue1] Testing...
708+ Content-Type: multipart/mixed; boundary="uh56ypi7view24rr"
709+ Content-Disposition: inline
710+
711+ --uh56ypi7view24rr
712+ Content-Type: text/plain; charset=us-ascii
713+ Content-Disposition: inline
714+
715+ Attach a file with non-ascii characters in it (encoded latin-1 should
716+ make it as-is through roundup due to Content-Type
717+ application/octet-stream)
718+ --
719+ Ralf Schlatterbeck email: [email protected] 720+
721+ --uh56ypi7view24rr
722+ Content-Type: application/octet-stream
723+ Content-Disposition: attachment;
724+ filename==?iso-8859-1?Q?20210312=5FM=FCnchen=5FRepor?=
725+ =?iso-8859-1?Q?t.pdf?=
726+ Content-Transfer-Encoding: quoted-printable
727+
728+ This is a file containing text
729+ in latin-1 format =E4=F6=FC=C4=D6=DC=DF
730+
700731--uh56ypi7view24rr--
701732'''
702733
@@ -845,6 +876,22 @@ def testOctetStreamTranscoding(self):
845876 names = {0 : 'testfile' }
846877 content = [b'''This is a file containing text
847878in latin-1 format \xE4 \xF6 \xFC \xC4 \xD6 \xDC \xDF
879+ ''' ]
880+ for n , id in enumerate (msg .files ):
881+ f = self .db .file .getnode (id )
882+ self .assertEqual (f .name , names .get (n , 'unnamed' ))
883+ self .assertEqual (f .binary_content , content [n ])
884+
885+ def testFileAttachWithUmlaut (self ):
886+ self .doNewIssue ()
887+ self ._handle_mail (self .filename_msg )
888+ messages = self .db .issue .get ('1' , 'messages' )
889+ messages .sort ()
890+ msg = self .db .msg .getnode (messages [- 1 ])
891+ assert (len (msg .files ) == 1 )
892+ names = {0 : u'20210312_M\xfc nchen_Report.pdf' }
893+ content = [b'''This is a file containing text
894+ in latin-1 format \xE4 \xF6 \xFC \xC4 \xD6 \xDC \xDF
848895''' ]
849896 for n , id in enumerate (msg .files ):
850897 f = self .db .file .getnode (id )
0 commit comments