[Zope-CVS] CVS: Products/CookieCrumbler/tests - testCookieCrumbler.py:1.4
Shane Hathaway
shane@zope.com
Wed, 18 Jun 2003 11:49:42 -0400
Update of /cvs-repository/Products/CookieCrumbler/tests
In directory cvs.zope.org:/tmp/cvs-serv13933/tests
Modified Files:
testCookieCrumbler.py
Log Message:
CookieCrumblers are now folders that hold login forms.
This makes it easier to use CookieCrumblers in sites that disallow
anonymous access. You now only need to grant the "View" permission to
anonymous users in the context of the cookie crumbler.
=== Products/CookieCrumbler/tests/testCookieCrumbler.py 1.3 => 1.4 ===
--- Products/CookieCrumbler/tests/testCookieCrumbler.py:1.3 Fri Jun 13 12:40:04 2003
+++ Products/CookieCrumbler/tests/testCookieCrumbler.py Wed Jun 18 11:49:41 2003
@@ -31,7 +31,7 @@
from ZPublisher.HTTPResponse import HTTPResponse
from ZPublisher.BaseRequest import RequestContainer
-from Products.CookieCrumbler.CookieCrumbler import CookieCrumbler
+from Products.CookieCrumbler.CookieCrumbler import CookieCrumbler, manage_addCC
def makerequest(root, stdout, stdin=None):
@@ -281,6 +281,17 @@
self.assert_(self.req.has_key('AUTHENTICATED_USER'))
self.assertEqual(self.req['AUTHENTICATED_USER'].getUserName(),
'isaac')
+
+
+ def testCreateForms(self):
+ # Verify the factory creates the login forms.
+ self.root._delObject('cookie_authentication')
+ manage_addCC(self.root, 'login', create_forms=1)
+ ids = self.root.login.objectIds()
+ ids.sort()
+ self.assertEqual(tuple(ids), (
+ 'index_html', 'logged_in', 'logged_out', 'login_form',
+ 'standard_login_footer', 'standard_login_header'))
if __name__ == '__main__':