[Checkins] SVN: Products.CMFCalendar/trunk/Products/CMFCalendar/tests/test_Calendar.py - test with correctly wrapped user

Yvo Schubbe y.2011 at wcm-solutions.de
Wed Feb 16 10:54:28 EST 2011


Log message for revision 120388:
  - test with correctly wrapped user

Changed:
  U   Products.CMFCalendar/trunk/Products/CMFCalendar/tests/test_Calendar.py

-=-
Modified: Products.CMFCalendar/trunk/Products/CMFCalendar/tests/test_Calendar.py
===================================================================
--- Products.CMFCalendar/trunk/Products/CMFCalendar/tests/test_Calendar.py	2011-02-16 15:53:42 UTC (rev 120387)
+++ Products.CMFCalendar/trunk/Products/CMFCalendar/tests/test_Calendar.py	2011-02-16 15:54:28 UTC (rev 120388)
@@ -20,7 +20,6 @@
 import locale
 
 from AccessControl.SecurityManagement import newSecurityManager
-from AccessControl.User import UnrestrictedUser
 from DateTime import DateTime
 from zope.interface.verify import verifyClass
 from zope.site.hooks import setSite
@@ -106,9 +105,12 @@
     layer = FunctionalLayer
 
     def afterSetUp(self):
-        setSite(self.app.site)
-        self.app.site.setupCurrentSkin(self.app.REQUEST)
-        newSecurityManager(None, UnrestrictedUser('god', '', ['Manager'], ''))
+        site = self.app.site
+        setSite(site)
+        site.setupCurrentSkin(self.app.REQUEST)
+        site.acl_users._doAddUser('god', 'secret', ['Manager'], [])
+        user = site.acl_users.getUser('god').__of__(site.acl_users)
+        newSecurityManager(None, user)
 
         # sessioning setup
         sdm = self.app.session_data_manager



More information about the checkins mailing list