[Zope3-checkins] CVS: Zope3/src/zope/app/registration/browser/tests - test_changeregistrations.py:1.2

Jim Fulton jim at zope.com
Thu Apr 8 17:03:11 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/registration/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv12425/src/zope/app/registration/browser/tests

Modified Files:
	test_changeregistrations.py 
Log Message:
Removed the id key from info. Views can compute this if they want it.

Also, got rid of the keep_dummy option to info.  Clients didn't seem
to trust it anyway, so it did no good.  The info method doesn't return 
dummy entries (for the None stack marker) anymore,


=== Zope3/src/zope/app/registration/browser/tests/test_changeregistrations.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/registration/browser/tests/test_changeregistrations.py:1.1	Sat Mar 13 13:01:18 2004
+++ Zope3/src/zope/app/registration/browser/tests/test_changeregistrations.py	Thu Apr  8 17:02:40 2004
@@ -19,13 +19,17 @@
 from unittest import TestCase, TestSuite, main, makeSuite
 from zope.publisher.browser import TestRequest
 from zope.app.registration.tests.registrationstack \
-     import TestingRegistrationStack
+     import TestingRegistrationStack, TestingRegistration
 from zope.app.registration.browser import ChangeRegistrations
 
+a = TestingRegistration('a')
+b = TestingRegistration('b')
+c = TestingRegistration('c')
+
 class Test(TestCase):
 
     def test_applyUpdates_and_setPrefix(self):
-        registry = TestingRegistrationStack('a', 'b', 'c')
+        registry = TestingRegistrationStack(a, b, c)
         request = TestRequest()
         view = ChangeRegistrations(registry, request)
         view.setPrefix("Pigs")
@@ -33,17 +37,23 @@
         # Make sure we don't apply updates unless asked to
         request.form = {'Pigs.active': 'disable'}
         view.applyUpdates()
-        self.assertEqual(registry._data, ('a', 'b', 'c'))
+        data = [(info['active'], info['registration'])
+                for info in registry.info()]
+        self.assertEqual(data, [(True, a), (False, b), (False, c)])
 
         # Now test disabling
         request.form = {'submit_update': '', 'Pigs.active': 'disable'}
         view.applyUpdates()
-        self.assertEqual(registry._data, (None, 'a', 'b', 'c'))
+        data = [(info['active'], info['registration'])
+                for info in registry.info()]
+        self.assertEqual(data, [(False, a), (False, b), (False, c)])
 
         # Now test enabling c
         request.form = {'submit_update': '', 'Pigs.active': 'c'}
         view.applyUpdates()
-        self.assertEqual(registry._data, ('c', 'a', 'b'))
+        data = [(info['active'], info['registration'])
+                for info in registry.info()]
+        self.assertEqual(data, [(True, c), (False, a), (False, b)])
 
 
 def test_suite():




More information about the Zope3-Checkins mailing list