[Checkins] SVN: zope.component/branches/tlotze-hooks/src/zope/component/hooks.txt a little more testing for setSite
Thomas Lotze
tl at gocept.com
Thu Oct 22 05:55:14 EDT 2009
Log message for revision 105209:
a little more testing for setSite
Changed:
U zope.component/branches/tlotze-hooks/src/zope/component/hooks.txt
-=-
Modified: zope.component/branches/tlotze-hooks/src/zope/component/hooks.txt
===================================================================
--- zope.component/branches/tlotze-hooks/src/zope/component/hooks.txt 2009-10-22 09:31:57 UTC (rev 105208)
+++ zope.component/branches/tlotze-hooks/src/zope/component/hooks.txt 2009-10-22 09:55:14 UTC (rev 105209)
@@ -43,3 +43,23 @@
True
>>> getSiteManager() is site1.registry
True
+
+If we set another site, that one will be considered current:
+
+>>> site2 = Site()
+>>> site2.registry is not site1.registry
+True
+>>> setSite(site2)
+
+>>> getSite() is site2
+True
+>>> getSiteManager() is site2.registry
+True
+
+Finally we can unset the site and the global component registry is used again:
+
+>>> setSite()
+>>> print getSite()
+None
+>>> getSiteManager()
+<BaseGlobalComponents base>
More information about the checkins
mailing list