[Zope3-checkins] SVN: zope.formlib/trunk/src/zope/formlib/tests.py made zope.formlib work with Python2.5

nikhil n nikhil.n.n at gmail.com
Mon Aug 6 12:31:10 EDT 2007


Log message for revision 78630:
  made zope.formlib work with Python2.5

Changed:
  U   zope.formlib/trunk/src/zope/formlib/tests.py

-=-
Modified: zope.formlib/trunk/src/zope/formlib/tests.py
===================================================================
--- zope.formlib/trunk/src/zope/formlib/tests.py	2007-08-06 15:01:28 UTC (rev 78629)
+++ zope.formlib/trunk/src/zope/formlib/tests.py	2007-08-06 16:31:10 UTC (rev 78630)
@@ -16,9 +16,11 @@
 """
 import unittest
 import os
+import re
 import pytz
 
 from zope import component, interface
+from zope.testing import renormalizing
 import zope.interface.common.idatetime
 import zope.i18n.testing
 import zope.publisher.interfaces
@@ -480,6 +482,14 @@
 
 def test_suite():
     from zope.testing import doctest
+    checker = renormalizing.RENormalizing([
+      (re.compile(r"\[WidgetInputError\('form.summary', 'summary', A error message\)\]"),
+                  r"[<zope.app.form.interfaces.WidgetInputError instance at ...>]"),
+      (re.compile(r"\[WidgetInputError\('summary', u'Summary', None\)\]"),
+                  r"[<zope.app.form.interfaces.WidgetInputError instance at ...>]"),
+      (re.compile(r" ValueError\('invalid literal for float\(\): (bob'|10,0'),\)"),
+                  r"\n <exceptions.ValueError instance at ...>"),
+    ])
     errors = functional.FunctionalDocFileSuite("errors.txt")
     errors.layer = FormlibLayer
     return unittest.TestSuite((
@@ -487,9 +497,11 @@
             'form.txt',
             setUp=formSetUp, tearDown=zope.component.testing.tearDown,
             optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+            checker=checker
             ),
         doctest.DocTestSuite(
             setUp=formSetUp, tearDown=zope.component.testing.tearDown,
+            checker=checker
             ),
         doctest.DocFileSuite(
             'namedtemplate.txt',



More information about the Zope3-Checkins mailing list