[Zope-Checkins]
SVN: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
added some more tests to reflect the desired behavior on
lower-casing
Andreas Jung
andreas at andreas-jung.com
Sat Dec 29 12:12:18 EST 2007
Log message for revision 82555:
added some more tests to reflect the desired behavior on lower-casing
attribute names for content_type text/html and text/xml
Changed:
U Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-12-29 17:07:32 UTC (rev 82554)
+++ Zope/trunk/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py 2007-12-29 17:12:17 UTC (rev 82555)
@@ -63,7 +63,20 @@
html_iso_8859_15_wo_header = html_template_wo_header
html_utf8_wo_header = unicode(html_template_wo_header, 'iso-8859-15').encode('utf-8')
+xml_with_upper_attr = '''<?xml version="1.0"?>
+<foo>
+ <bar ATTR="1" />
+</foo>
+'''
+html_with_upper_attr = '''<html><body>
+<foo>
+ <bar ATTR="1" />
+</foo>
+</body></html>
+'''
+
+
installProduct('PageTemplates')
class ZPTUtilsTests(unittest.TestCase):
@@ -241,6 +254,19 @@
self.assertEqual(zpt.content_type, 'text/xml')
result = zpt.pt_render() # should not raise an exception
+ def testXMLAttrsMustNotBeLowercased(self):
+ zpt = self._put(xml_with_upper_attr)
+ self.assertEqual(zpt.content_type, 'text/xml')
+ result = zpt.pt_render()
+ self.assertEqual('ATTR' in result, True)
+
+ def testHTMLAttrsAreLowerCased(self):
+ zpt = self._put(html_with_upper_attr)
+ self.content_type = 'text/html'
+ result = zpt.pt_render()
+ self.assertEqual('ATTR' in result, False)
+
+
class ZPTRegressions(unittest.TestCase):
def setUp(self):
More information about the Zope-Checkins
mailing list