[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_registrationstack.py:1.2
Fred L. Drake, Jr.
fred@zope.com
Wed, 2 Jul 2003 15:43:36 -0400
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv7734/src/zope/app/services/tests
Modified Files:
test_registrationstack.py
Log Message:
RegistrationStack.unregsiter(): do not re-activate a registration that is
already active.
=== Zope3/src/zope/app/services/tests/test_registrationstack.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/services/tests/test_registrationstack.py:1.1 Sat Jun 21 17:22:13 2003
+++ Zope3/src/zope/app/services/tests/test_registrationstack.py Wed Jul 2 15:43:32 2003
@@ -234,6 +234,23 @@
},
])
+ def test_avoid_duplicate_activation(self):
+ # Test for a specific bug that used to exist:
+ # when unregistering an inactive registration, don't
+ # re-activate the registration that's already active
+ c1 = self.__config('1')
+ c2 = self.__config('2')
+ registry = self.__registry
+ registry.register(c1)
+ registry.register(c2)
+ registry.activate(c1)
+ self.assertEqual(c1.active, 1)
+ self.assertEqual(c2.active, 0)
+ registry.unregister(c2)
+ self.assertEqual(c1.active, 1)
+ self.assertEqual(c2.active, 0)
+
+
def test_suite():
return TestSuite((
makeSuite(Test),