Mercurial > p > roundup > code
comparison test/test_cgi.py @ 2023:e68b3c9a3b78 maint-0.6
fix tests to match new parsePropsFromForm API
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 15 Feb 2004 23:16:20 +0000 |
| parents | 5a04969176dc |
| children |
comparison
equal
deleted
inserted
replaced
| 2022:2fe25413867f | 2023:e68b3c9a3b78 |
|---|---|
| 6 # | 6 # |
| 7 # This module is distributed in the hope that it will be useful, | 7 # This module is distributed in the hope that it will be useful, |
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 # | 10 # |
| 11 # $Id: test_cgi.py,v 1.18 2003-08-11 11:28:31 jlgijsbers Exp $ | 11 # $Id: test_cgi.py,v 1.18.2.1 2004-02-15 23:16:20 richard Exp $ |
| 12 | 12 |
| 13 import unittest, os, shutil, errno, sys, difflib, cgi, re | 13 import unittest, os, shutil, errno, sys, difflib, cgi, re |
| 14 | 14 |
| 15 from roundup.cgi import client | 15 from roundup.cgi import client |
| 16 from roundup import init, instance, password, hyperdb, date | 16 from roundup import init, instance, password, hyperdb, date |
| 92 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, | 92 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, |
| 93 makeForm(form)) | 93 makeForm(form)) |
| 94 cl.classname = classname | 94 cl.classname = classname |
| 95 cl.nodeid = nodeid | 95 cl.nodeid = nodeid |
| 96 cl.db = self.db | 96 cl.db = self.db |
| 97 return cl.parsePropsFromForm() | 97 return cl.parsePropsFromForm(create=1) |
| 98 | 98 |
| 99 def tearDown(self): | 99 def tearDown(self): |
| 100 self.db.close() | 100 self.db.close() |
| 101 try: | 101 try: |
| 102 shutil.rmtree(self.dirname) | 102 shutil.rmtree(self.dirname) |
| 266 form.list.append(cgi.MiniFieldStorage('nosy', '3')) | 266 form.list.append(cgi.MiniFieldStorage('nosy', '3')) |
| 267 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) | 267 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, form) |
| 268 cl.classname = 'issue' | 268 cl.classname = 'issue' |
| 269 cl.nodeid = None | 269 cl.nodeid = None |
| 270 cl.db = self.db | 270 cl.db = self.db |
| 271 self.assertEqual(cl.parsePropsFromForm(), | 271 self.assertEqual(cl.parsePropsFromForm(create=1), |
| 272 ({('issue', None): {'nosy': ['1','2', '3']}}, [])) | 272 ({('issue', None): {'nosy': ['1','2', '3']}}, [])) |
| 273 | 273 |
| 274 def testEmptyMultilinkSet(self): | 274 def testEmptyMultilinkSet(self): |
| 275 nodeid = self.db.issue.create(nosy=['1','2']) | 275 nodeid = self.db.issue.create(nosy=['1','2']) |
| 276 self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), | 276 self.assertEqual(self.parseForm({'nosy': ''}, 'issue', nodeid), |
