示例#1
0
    def test_zipexport_works_on_mail(self, browser):
        browser.login().visit(self.mail, view='zip_export')
        self.assertEquals('application/zip', browser.headers['Content-Type'])
        self.assertEquals('inline; filename="Die B\xc3\xbcrgschaft.zip"',
                          browser.headers['Content-Disposition'])

        zipfile = ZipFile(StringIO(browser.contents))
        self.assertEquals(['message.eml'], zipfile.namelist())
        self.assertMultiLineEqual(mail_asset('latin1').read(),
                                  zipfile.read('message.eml'))
示例#2
0
 def setUp(self):
     self.mail = create(Builder('mail').with_message(mail_asset('latin1')))