Mercurial > p > roundup > code
comparison test/test_cgi.py @ 2004:1782fe36e7b8
Move out parts of client.py to new modules:
* actions.py - the xxxAction and xxxPermission functions refactored
into Action classes
* exceptions.py - all exceptions
* form_parser.py - parsePropsFromForm & extractFormList in a FormParser class
Also added some new tests for the Actions.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Wed, 11 Feb 2004 21:34:31 +0000 |
| parents | f63aa57386b0 |
| children | 45ad02759998 |
comparison
equal
deleted
inserted
replaced
| 2003:a291bf753037 | 2004:1782fe36e7b8 |
|---|---|
| 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.21 2003-10-25 22:53:26 richard Exp $ | 11 # $Id: test_cgi.py,v 1.22 2004-02-11 21:34:31 jlgijsbers 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.cgi.client import FormError | 16 from roundup.cgi.errors import FormError |
| 17 from roundup.cgi.FormParser import FormParser | |
| 17 from roundup import init, instance, password, hyperdb, date | 18 from roundup import init, instance, password, hyperdb, date |
| 18 | 19 |
| 19 NEEDS_INSTANCE = 1 | 20 NEEDS_INSTANCE = 1 |
| 20 | 21 |
| 21 class FileUpload: | 22 class FileUpload: |
| 87 multilink=hyperdb.Multilink('test'), date=hyperdb.Date(), | 88 multilink=hyperdb.Multilink('test'), date=hyperdb.Date(), |
| 88 interval=hyperdb.Interval()) | 89 interval=hyperdb.Interval()) |
| 89 | 90 |
| 90 # compile the labels re | 91 # compile the labels re |
| 91 classes = '|'.join(self.db.classes.keys()) | 92 classes = '|'.join(self.db.classes.keys()) |
| 92 self.FV_SPECIAL = re.compile(client.Client.FV_LABELS%classes, | 93 self.FV_SPECIAL = re.compile(FormParser.FV_LABELS%classes, |
| 93 re.VERBOSE) | 94 re.VERBOSE) |
| 94 | 95 |
| 95 def parseForm(self, form, classname='test', nodeid=None): | 96 def parseForm(self, form, classname='test', nodeid=None): |
| 96 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, | 97 cl = client.Client(self.instance, None, {'PATH_INFO':'/'}, |
| 97 makeForm(form)) | 98 makeForm(form)) |
