[Zope3-checkins] CVS: Zope3/src/zope/app/xml/tests - test_field.py:1.2
Martijn Faassen
m.faassen@vet.uu.nl
Thu, 10 Apr 2003 05:05:14 -0400
Update of /cvs-repository/Zope3/src/zope/app/xml/tests
In directory cvs.zope.org:/tmp/cvs-serv16658/zope/app/xml/tests
Modified Files:
test_field.py
Log Message:
Added a knob to XML field to turn off wellformedness parsing. This can
then be used to optimize cases where we do XML parsing anyway.
=== Zope3/src/zope/app/xml/tests/test_field.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/xml/tests/test_field.py:1.1 Wed Apr 9 05:31:53 2003
+++ Zope3/src/zope/app/xml/tests/test_field.py Thu Apr 10 05:05:14 2003
@@ -42,7 +42,15 @@
readonly=False, required=True)
self.assertRaisesErrorNames(errornames.RequiredMissing,
field.validate, None)
-
+
+ def testTurnOffWellformedness(self):
+ field = XML(title=u"XML field")
+ field.check_wellformedness = False
+ field.validate('bad')
+ field.check_wellformedness = True
+ self.assertRaisesErrorNames(NotWellFormedXML, field.validate, 'bad')
+
+
def test_suite():
return unittest.TestSuite([
unittest.makeSuite(XMLFieldTestCase)