[Zope3-checkins] CVS: Zope3/src/zope/publisher/tests -
test_browserrequest.py:1.12
Dmitry Vasiliev
dima at hlabs.spb.ru
Thu Apr 8 04:31:32 EDT 2004
Update of /cvs-repository/Zope3/src/zope/publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv24500/src/zope/publisher/tests
Modified Files:
test_browserrequest.py
Log Message:
'BrowserRequest.processInputs' long method was splitted into small parts.
=== Zope3/src/zope/publisher/tests/test_browserrequest.py 1.11 => 1.12 ===
--- Zope3/src/zope/publisher/tests/test_browserrequest.py:1.11 Fri Mar 19 15:26:44 2004
+++ Zope3/src/zope/publisher/tests/test_browserrequest.py Thu Apr 8 04:31:31 2004
@@ -208,11 +208,43 @@
{u'a':u'5', u'b':6})
def testFormListTypes(self):
- #extra = {'QUERY_STRING':'x.a:list:record=5&x.a:list:record=6'}
extra = {'QUERY_STRING':'a:list=5&a:list=6&b=1'}
request = self._createRequest(extra)
publish(request)
self.assertEqual(request.form, {u'a':[u'5',u'6'], u'b':u'1'})
+
+ def testFormTupleTypes(self):
+ extra = {'QUERY_STRING':'a:tuple=5&a:tuple=6&b=1'}
+ request = self._createRequest(extra)
+ publish(request)
+ self.assertEqual(request.form, {u'a':(u'5',u'6'), u'b':u'1'})
+
+ def testFormTupleRecordTypes(self):
+ extra = {'QUERY_STRING':'a.x:tuple:record=5&a.x:tuple:record=6&b=1'}
+ request = self._createRequest(extra)
+ publish(request)
+ keys = request.form.keys()
+ keys.sort()
+ self.assertEqual(keys, [u'a',u'b'])
+ self.assertEqual(request.form[u'b'], u'1')
+ self.assertEqual(request.form[u'a'].keys(), [u'x'])
+ self.assertEqual(request.form[u'a'][u'x'], (u'5',u'6'))
+ self.assertEqual(str(request.form[u'a']), "x: (u'5', u'6')")
+ self.assertEqual(repr(request.form[u'a']), "x: (u'5', u'6')")
+
+ def testFormRecordsTypes(self):
+ extra = {'QUERY_STRING':'a.x:records=5&a.x:records=6&b=1'}
+ request = self._createRequest(extra)
+ publish(request)
+ keys = request.form.keys()
+ keys.sort()
+ self.assertEqual(keys, [u'a',u'b'])
+ self.assertEqual(request.form[u'b'], u'1')
+ self.assertEqual(len(request.form[u'a']), 2)
+ self.assertEqual(request.form[u'a'][0][u'x'], u'5')
+ self.assertEqual(request.form[u'a'][1][u'x'], u'6')
+ self.assertEqual(str(request.form[u'a']), "[x: u'5', x: u'6']")
+ self.assertEqual(repr(request.form[u'a']), "[x: u'5', x: u'6']")
def testFormListRecordTypes(self):
extra = {'QUERY_STRING':'a.x:list:record=5&a.x:list:record=6&b=1'}
More information about the Zope3-Checkins
mailing list