[Zope3-checkins]
CVS: Zope3/src/zope/app/browser/services/registration/tests
- test_registrationstatuswidget.py:1.2
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Aug 7 21:15:13 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/services/registration/tests
In directory cvs.zope.org:/tmp/cvs-serv25289/browser/services/registration/tests
Modified Files:
test_registrationstatuswidget.py
Log Message:
I18ned some more. Wow, the RegistrationWidget was tricky, but I fixed it.
I made the RegistrationWidget inherit from RadioWidget, which should have
been done this way in the first place.
I also noticed that there are still occurences where the interface field
attributes are not message-id'ed.
=== Zope3/src/zope/app/browser/services/registration/tests/test_registrationstatuswidget.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/services/registration/tests/test_registrationstatuswidget.py:1.1 Sat Jun 21 17:22:03 2003
+++ Zope3/src/zope/app/browser/services/registration/tests/test_registrationstatuswidget.py Thu Aug 7 20:14:38 2003
@@ -11,9 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""XXX short summary goes here.
-
-XXX longer description goes here.
+"""Registration Widget Tests
$Id$
"""
@@ -22,9 +20,14 @@
from zope.publisher.browser import TestRequest
from zope.app.interfaces.services.registration import RegistrationStatus
from zope.app.browser.services.registration import RegistrationStatusWidget
+from zope.app.tests.placelesssetup import PlacelessSetup
+
-class Test(TestCase):
+class Test(PlacelessSetup, TestCase):
+ def setUp(self):
+ PlacelessSetup.setUp(self)
+
def test_call(self):
field = RegistrationStatus(__name__="status")
request = TestRequest()
@@ -34,53 +37,62 @@
text = ' '.join(widget().split())
self.assertEqual(
text,
- '<label><input type="radio" name="f.status" value="Unregistered"'
- ' checked>'
- ' Unregistered</label> '
- '<label><input type="radio" name="f.status" value="Registered">'
- ' Registered</label> '
- '<label><input type="radio" name="f.status" value="Active">'
- ' Active</label>'
- )
+ u'<input class="radioType" checked="checked" id="f.status.0" '
+ u'name="f.status" type="radio" value="Unregistered" />'
+ u'<label for="f.status.0">Unregistered</label> '
+ u'<input class="radioType" id="f.status.1" name="f.status" '
+ u'type="radio" value="Registered" />'
+ u'<label for="f.status.1">Registered</label> '
+ u'<input class="radioType" id="f.status.2" name="f.status" '
+ u'type="radio" value="Active" />'
+ u'<label for="f.status.2">Active</label>')
request.form['f.status'] = u'Registered'
text = ' '.join(widget().split())
self.assertEqual(
text,
- '<label><input type="radio" name="f.status" value="Unregistered">'
- ' Unregistered</label> '
- '<label><input type="radio" name="f.status" value="Registered"'
- ' checked>'
- ' Registered</label> '
- '<label><input type="radio" name="f.status" value="Active">'
- ' Active</label>'
- )
+ u'<input class="radioType" id="f.status.0" name="f.status" '
+ u'type="radio" value="Unregistered" /><label '
+ u'for="f.status.0">Unregistered</label>'
+ u' '
+ u'<input class="radioType" checked="checked" id="f.status.1" '
+ u'name="f.status" type="radio" value="Registered" /><label '
+ u'for="f.status.1">Registered</label>'
+ u' '
+ u'<input class="radioType" id="f.status.2" name="f.status" '
+ u'type="radio" value="Active" /><label '
+ u'for="f.status.2">Active</label>')
widget.setData("Active")
text = ' '.join(widget().split())
self.assertEqual(
text,
- '<label><input type="radio" name="f.status" value="Unregistered">'
- ' Unregistered</label> '
- '<label><input type="radio" name="f.status" value="Registered">'
- ' Registered</label> '
- '<label><input type="radio" name="f.status" value="Active"'
- ' checked>'
- ' Active</label>'
+ u'<input class="radioType" id="f.status.0" name="f.status" '
+ u'type="radio" value="Unregistered" />'
+ u'<label for="f.status.0">Unregistered</label>'
+ u' '
+ u'<input class="radioType" id="f.status.1" name="f.status" '
+ u'type="radio" value="Registered" />'
+ u'<label for="f.status.1">Registered</label>'
+ u' '
+ u'<input class="radioType" checked="checked" id="f.status.2" '
+ u'name="f.status" type="radio" value="Active" />'
+ u'<label for="f.status.2">Active</label>'
)
widget.setData(u"Unregistered")
text = ' '.join(widget().split())
self.assertEqual(
text,
- '<label><input type="radio" name="f.status" value="Unregistered"'
- ' checked>'
- ' Unregistered</label> '
- '<label><input type="radio" name="f.status" value="Registered">'
- ' Registered</label> '
- '<label><input type="radio" name="f.status" value="Active">'
- ' Active</label>'
- )
+ u'<input class="radioType" checked="checked" id="f.status.0" '
+ u'name="f.status" type="radio" value="Unregistered" />'
+ u'<label for="f.status.0">Unregistered</label> '
+ u'<input class="radioType" id="f.status.1" name="f.status" '
+ u'type="radio" value="Registered" />'
+ u'<label for="f.status.1">Registered</label> '
+ u'<input class="radioType" id="f.status.2" name="f.status" '
+ u'type="radio" value="Active" />'
+ u'<label for="f.status.2">Active</label>')
def test_suite():
More information about the Zope3-Checkins
mailing list