[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/ Merge from
baijum-test-layers branch:
Baiju M
baiju.m.mail at gmail.com
Sat Feb 3 00:38:09 EST 2007
Log message for revision 72342:
Merge from baijum-test-layers branch:
Added AppFormLayer to existing ftests.
Changed:
U Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_decimalwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_i18n.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_objectwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_selectwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
A Zope3/trunk/src/zope/app/form/ftesting.zcml
A Zope3/trunk/src/zope/app/form/testing.py
-=-
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_booleanradiowidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -13,7 +13,7 @@
##############################################################################
"""Radio Widget Functional Tests
-$Id: $
+$Id$
"""
import unittest
import transaction
@@ -24,6 +24,7 @@
from zope.schema import Bool
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -53,7 +54,7 @@
# display edit view
response = self.publish('/foo/edit.html')
self.assertEqual(response.getStatus(), 200)
-
+
# bar field should be displayed as two radio buttons
self.assert_(patternExists(
'<input .*checked="checked".*name="field.bar".*type="radio".*'
@@ -88,7 +89,7 @@
def test_missing_value(self):
self.getRootFolder()['foo'] = Foo()
transaction.commit()
-
+
# temporarily make bar field not required
IFoo['bar'].required = False
@@ -103,7 +104,7 @@
self.assert_(IFoo['bar'].missing_value is None)
object = traverse(self.getRootFolder(), 'foo')
self.assert_(object.bar is None)
-
+
# restore bar required state
IFoo['bar'].required = True
@@ -111,7 +112,7 @@
def test_required_validation(self):
self.getRootFolder()['foo'] = Foo()
transaction.commit()
-
+
self.assert_(IFoo['bar'].required)
# submit missing value for required field bar
@@ -119,7 +120,7 @@
'UPDATE_SUBMIT' : '',
'field.bar-empty-marker' : '1'})
self.assertEqual(response.getStatus(), 200)
-
+
# confirm error msgs
self.assert_(missingInputErrorExists('bar', response.getBody()))
@@ -140,6 +141,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_checkboxwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,6 +24,7 @@
from zope.schema import Bool
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser import CheckBoxWidget
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -139,6 +140,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -27,6 +27,7 @@
from zope.schema import Datetime, Choice
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -222,6 +223,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_decimalwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_decimalwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_decimalwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -23,8 +23,9 @@
import zope.security.checker
from zope.interface import Interface, implements
from zope.traversing.api import traverse
+from zope.schema import Decimal, Choice
-from zope.schema import Decimal, Choice
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -225,6 +226,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_editview.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -13,7 +13,7 @@
##############################################################################
"""Editview tests
-$Id: test_checkboxwidget.py 26267 2004-07-08 23:06:19Z garrett $
+$Id$
"""
import unittest
import transaction
@@ -24,6 +24,7 @@
from zope.schema import TextLine
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -74,6 +75,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_filewidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -26,6 +26,7 @@
from zope.schema import Field
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.textwidgets import FileWidget
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -165,6 +166,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -22,8 +22,9 @@
import zope.security.checker
from zope.interface import Interface, implements
from zope.traversing.api import traverse
+from zope.schema import Float, Choice
-from zope.schema import Float, Choice
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -214,6 +215,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_i18n.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_i18n.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_i18n.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -22,6 +22,7 @@
from zope.schema import TextLine, Text, Int, List
from zope.i18nmessageid import MessageFactory
from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.app.form.testing import AppFormLayer
_ = MessageFactory('formtest')
@@ -60,9 +61,11 @@
implements(IFieldContent)
def test_suite():
+ i18n = FunctionalDocFileSuite('i18n.txt', package='zope.app.form.browser',
+ optionflags=doctest.ELLIPSIS)
+ i18n.layer = AppFormLayer
return unittest.TestSuite([
- FunctionalDocFileSuite('i18n.txt', package='zope.app.form.browser',
- optionflags=doctest.ELLIPSIS)
+ i18n,
])
if __name__ == '__main__':
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,6 +24,7 @@
from zope.schema import Int, Choice
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.testing.functional import BrowserTestCase
from zope.app.form.browser.ftests.support import *
@@ -267,6 +268,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_objectwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_objectwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_objectwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,8 +24,8 @@
from zope.app.form.browser import ObjectWidget
from zope.app.testing.functional import BrowserTestCase
from zope.app.form.browser.tests import support
+from zope.app.form.testing import AppFormLayer
-
class ITestContact(Interface):
name = TextLine()
email = TextLine()
@@ -68,6 +68,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_selectwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_selectwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_selectwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,6 +24,7 @@
from zope.schema import TextLine, Choice
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -137,6 +138,7 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,6 +24,7 @@
from zope.schema import Text
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -101,7 +102,7 @@
def test_invalid_type(self):
"""Tests textarea widget's handling of invalid unicode input.
-
+
The text widget will succeed in converting any form input into
unicode.
"""
@@ -222,12 +223,11 @@
self.assert_(patternExists('line1\r\nline2', response.getBody()))
-
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
if __name__=='__main__':
unittest.main(defaultTest='test_suite')
-
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2007-02-02 23:07:31 UTC (rev 72341)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2007-02-03 05:38:07 UTC (rev 72342)
@@ -24,6 +24,7 @@
from zope.schema import TextLine, Choice
from zope.traversing.api import traverse
+from zope.app.form.testing import AppFormLayer
from zope.app.form.browser.ftests.support import *
from zope.app.testing.functional import BrowserTestCase
@@ -104,7 +105,7 @@
def test_invalid_type(self):
"""Tests text widget's handling of invalid unicode input.
-
+
The text widget will succeed in converting any form input into
unicode.
"""
@@ -221,9 +222,9 @@
def test_suite():
suite = unittest.TestSuite()
+ Test.layer = AppFormLayer
suite.addTest(unittest.makeSuite(Test))
return suite
if __name__=='__main__':
unittest.main(defaultTest='test_suite')
-
Copied: Zope3/trunk/src/zope/app/form/ftesting.zcml (from rev 72159, Zope3/branches/baijum-test-layers/src/zope/app/form/ftesting.zcml)
Property changes on: Zope3/trunk/src/zope/app/form/ftesting.zcml
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: Zope3/trunk/src/zope/app/form/testing.py (from rev 72159, Zope3/branches/baijum-test-layers/src/zope/app/form/testing.py)
Property changes on: Zope3/trunk/src/zope/app/form/testing.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Zope3-Checkins
mailing list