Mercurial > p > roundup > code
diff test/test_cgi.py @ 5519:14a61eabcea8
Fixed unicode issues for XML template with Python 2
| author | Christof Meerwald <cmeerw@cmeerw.org> |
|---|---|
| date | Sat, 25 Aug 2018 15:20:38 +0100 |
| parents | cd0ceb2afdb8 |
| children | be99aa02c616 |
line wrap: on
line diff
--- a/test/test_cgi.py Thu Aug 23 07:41:36 2018 +0100 +++ b/test/test_cgi.py Sat Aug 25 15:20:38 2018 +0100 @@ -807,6 +807,16 @@ </html> """.strip ()) + def testXMLTemplate(self): + page_template = """<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal"></feed>""" + pt = RoundupPageTemplate() + pt.pt_edit(page_template, 'application/xml') + + cl = self.setupClient({ }, 'issue', + env_addon = {'HTTP_REFERER': 'http://whoami.com/path/'}) + out = pt.render(cl, 'issue', MockNull()) + self.assertEquals(out, '<?xml version="1.0" encoding="UTF-8"?><feed\n xmlns="http://www.w3.org/2005/Atom"/>\n') + def testCsrfProtection(self): # need to set SENDMAILDEBUG to prevent # downstream issue when email is sent on successful
