[Zope3-checkins] CVS: Zope3/src/zope/app/form/browser/ftests - support.py:1.2 test_datetimewidget.py:1.3 test_floatwidget.py:1.3 test_intwidget.py:1.3 test_textareawidget.py:1.3 test_textwidget.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Sun Apr 11 06:34:56 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/form/browser/ftests
In directory cvs.zope.org:/tmp/cvs-serv4605/src/zope/app/form/browser/ftests

Modified Files:
	support.py test_datetimewidget.py test_floatwidget.py 
	test_intwidget.py test_textareawidget.py test_textwidget.py 
Log Message:


Updated test code to deal with the fact that all validation errors are classes
now.




=== Zope3/src/zope/app/form/browser/ftests/support.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/form/browser/ftests/support.py:1.1	Sat Mar 13 20:11:36 2004
+++ Zope3/src/zope/app/form/browser/ftests/support.py	Sun Apr 11 06:34:56 2004
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Support Functions for Widget Functional Tests
 
 $Id$
 """
-
 import re
 from zope.configuration import xmlconfig
 
@@ -75,7 +74,7 @@
 
 
 def missingInputErrorExists(field, source):
-    return validationErrorExists(field, 'Input is required', source)
+    return validationErrorExists(field, 'Required input is missing.', source)
 
 
 def invalidValueErrorExists(field, source):


=== Zope3/src/zope/app/form/browser/ftests/test_datetimewidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/ftests/test_datetimewidget.py:1.2	Tue Apr  6 16:58:08 2004
+++ Zope3/src/zope/app/form/browser/ftests/test_datetimewidget.py	Sun Apr 11 06:34:56 2004
@@ -11,11 +11,10 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""DateTime Widget Functional Tests
 
 $Id$
 """
-
 import unittest
 import re
 from persistence import Persistent
@@ -194,7 +193,7 @@
             'UPDATE_SUBMIT' : '',
             'field.d1' : str(datetime(2002, 12, 31, tzinfo=tzinfo(0))) })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('d1', 'Too small',
+        self.assert_(validationErrorExists('d1', 'Value is too small',
             response.getBody()))
 
         # submit value for i1 that is too high
@@ -202,7 +201,7 @@
             'UPDATE_SUBMIT' : '',
             'field.d1' : str(datetime(2021, 1, 1, tzinfo=tzinfo(0))) })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('d1', 'Too big',
+        self.assert_(validationErrorExists('d1', 'Value is too big',
             response.getBody()))
 
 


=== Zope3/src/zope/app/form/browser/ftests/test_floatwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/ftests/test_floatwidget.py:1.2	Tue Apr  6 16:58:08 2004
+++ Zope3/src/zope/app/form/browser/ftests/test_floatwidget.py	Sun Apr 11 06:34:56 2004
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Float Widget Functional Tests
 
 $Id$
 """
@@ -168,7 +168,7 @@
             'UPDATE_SUBMIT' : '',
             'field.f1' : '-1' })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('f1', 'Too small',
+        self.assert_(validationErrorExists('f1', 'Value is too small',
             response.getBody()))
 
         # submit value for f1 that is too high
@@ -176,7 +176,7 @@
             'UPDATE_SUBMIT' : '',
             'field.f1' : '1000.2' })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('f1', 'Too big',
+        self.assert_(validationErrorExists('f1', 'Value is too big',
             response.getBody()))
 
 


=== Zope3/src/zope/app/form/browser/ftests/test_intwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/ftests/test_intwidget.py:1.2	Tue Apr  6 16:58:08 2004
+++ Zope3/src/zope/app/form/browser/ftests/test_intwidget.py	Sun Apr 11 06:34:56 2004
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Int Widget Functional Tests
 
 $Id$
 """
@@ -224,7 +224,7 @@
             'UPDATE_SUBMIT' : '',
             'field.i1' : '-1' })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('i1', 'Too small',
+        self.assert_(validationErrorExists('i1', 'Value is too small',
             response.getBody()))
 
         # submit value for i1 that is too high
@@ -232,7 +232,7 @@
             'UPDATE_SUBMIT' : '',
             'field.i1' : '11' })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('i1', 'Too big',
+        self.assert_(validationErrorExists('i1', 'Value is too big',
             response.getBody()))
 
 


=== Zope3/src/zope/app/form/browser/ftests/test_textareawidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/ftests/test_textareawidget.py:1.2	Tue Apr  6 16:58:08 2004
+++ Zope3/src/zope/app/form/browser/ftests/test_textareawidget.py	Sun Apr 11 06:34:56 2004
@@ -11,7 +11,7 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""TextArea Functional Tests
 
 $Id$
 """
@@ -115,7 +115,7 @@
 
         self.assertEqual(response.getStatus(), 200)
         self.assert_(validationErrorExists(
-            's1', 'Wrong type', response.getBody()))
+            's1', 'Object is of wrong type.', response.getBody()))
 
 
     def test_missing_value(self):
@@ -167,14 +167,14 @@
             'field.s1' : u'a' })
         self.assertEqual(response.getStatus(), 200)
         self.assert_(validationErrorExists(
-            's1', 'Too short', response.getBody()))
+            's1', 'Value is too short', response.getBody()))
 
         # submit value for s1 that is too long
         response = self.publish('/test/edit.html', form={
             'UPDATE_SUBMIT' : '',
             'field.s1' : u'12345678901' })
         self.assertEqual(response.getStatus(), 200)
-        self.assert_(validationErrorExists('s1', 'Too long',
+        self.assert_(validationErrorExists('s1', 'Value is too long',
             response.getBody()))
 
 


=== Zope3/src/zope/app/form/browser/ftests/test_textwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/browser/ftests/test_textwidget.py:1.2	Tue Apr  6 16:58:08 2004
+++ Zope3/src/zope/app/form/browser/ftests/test_textwidget.py	Sun Apr 11 06:34:56 2004
@@ -113,7 +113,7 @@
 
         self.assertEqual(response.getStatus(), 200)
         self.assert_(validationErrorExists(
-            's1', 'Wrong type', response.getBody()))
+            's1', 'Object is of wrong type.', response.getBody()))
 
 
     def test_missing_value(self):
@@ -177,7 +177,7 @@
             'field.s1' : u'a' })
         self.assertEqual(response.getStatus(), 200)
         self.assert_(validationErrorExists(
-            's1', 'Too short', response.getBody()))
+            's1', 'Value is too short', response.getBody()))
 
         # submit value for s1 that is too long
         response = self.publish('/test/edit.html', form={
@@ -185,7 +185,7 @@
             'field.s1' : u'12345678901' })
         self.assertEqual(response.getStatus(), 200)
         self.assert_(validationErrorExists(
-            's1', 'Too long', response.getBody()))
+            's1', 'Value is too long', response.getBody()))
 
 
     def test_omitted_value(self):




More information about the Zope3-Checkins mailing list