[Zope-Checkins] CVS: Zope/lib/python/Products/Sessions/tests - testBrowserIdManager.py:1.10
Chris McDonough
chrism@zope.com
Sat, 10 Aug 2002 15:28:39 -0400
Update of /cvs-repository/Zope/lib/python/Products/Sessions/tests
In directory cvs.zope.org:/tmp/cvs-serv7971/tests
Modified Files:
testBrowserIdManager.py
Log Message:
Add getHiddenFormField method to browser id manager.
This method is a convenience function which allows you to obtain a snippet
of html containing a hidden input form element which contains the
browser id name and browser id value.
=== Zope/lib/python/Products/Sessions/tests/testBrowserIdManager.py 1.9 => 1.10 ===
--- Zope/lib/python/Products/Sessions/tests/testBrowserIdManager.py:1.9 Fri Jul 19 00:44:35 2002
+++ Zope/lib/python/Products/Sessions/tests/testBrowserIdManager.py Sat Aug 10 15:28:38 2002
@@ -227,6 +227,14 @@
r = self.m.encodeUrl(u)
self.failUnless( r == '%s&%s=%s' % (u, keystring, key) )
+ def testGetHiddenFormField(self):
+ keystring = self.m.getBrowserIdName()
+ key = self.m.getBrowserId()
+ html = self.m.getHiddenFormField()
+ expected = ('<input type="hidden" name="%s" value="%s">' %
+ (keystring, key))
+ self.failUnless( html == expected )
+
def test_suite():
testsuite = makeSuite(TestBrowserIdManager, 'test')
return testsuite