Mercurial > p > roundup > code
comparison test/test_cgi.py @ 6361:58817c3bf471
Fix roundup/test
Move the test-detectors in tx_Source_detector.py to roundup/test for two
reasons: It's used in the memorydb convenience functions and it may be
useful in other tests. Make the prefix a paramter of the convenience
functions to be usable in other tests.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Tue, 30 Mar 2021 14:16:28 +0200 |
| parents | bdcccd2b2141 |
| children | f2c31f5ec50b |
comparison
equal
deleted
inserted
replaced
| 6360:a77a7d04ed23 | 6361:58817c3bf471 |
|---|---|
| 19 from roundup.cgi.templating import HTMLItem, HTMLRequest, NoTemplate | 19 from roundup.cgi.templating import HTMLItem, HTMLRequest, NoTemplate |
| 20 from roundup.cgi.templating import HTMLProperty, _HTMLItem, anti_csrf_nonce | 20 from roundup.cgi.templating import HTMLProperty, _HTMLItem, anti_csrf_nonce |
| 21 from roundup.cgi.form_parser import FormParser | 21 from roundup.cgi.form_parser import FormParser |
| 22 from roundup import init, instance, password, hyperdb, date | 22 from roundup import init, instance, password, hyperdb, date |
| 23 from roundup.anypy.strings import u2s, b2s, s2b | 23 from roundup.anypy.strings import u2s, b2s, s2b |
| 24 from roundup.test.tx_Source_detector import init as tx_Source_init | |
| 24 | 25 |
| 25 from time import sleep | 26 from time import sleep |
| 26 | 27 |
| 27 # For testing very simple rendering | 28 # For testing very simple rendering |
| 28 from roundup.cgi.engine_zopetal import RoundupPageTemplate | 29 from roundup.cgi.engine_zopetal import RoundupPageTemplate |
| 81 class FormTestCase(FormTestParent, StringFragmentCmpHelper, unittest.TestCase): | 82 class FormTestCase(FormTestParent, StringFragmentCmpHelper, unittest.TestCase): |
| 82 | 83 |
| 83 def setUp(self): | 84 def setUp(self): |
| 84 FormTestParent.setUp(self) | 85 FormTestParent.setUp(self) |
| 85 | 86 |
| 86 vars = {} | 87 tx_Source_init(self.db) |
| 87 thisdir = os.path.dirname(__file__) | |
| 88 exec(compile(open(os.path.join(thisdir, | |
| 89 "tx_Source_detector.py")).read(), | |
| 90 os.path.join(thisdir, "tx_Source_detector.py"), 'exec'), | |
| 91 vars) | |
| 92 vars['init'](self.db) | |
| 93 | 88 |
| 94 test = self.instance.backend.Class(self.db, "test", | 89 test = self.instance.backend.Class(self.db, "test", |
| 95 string=hyperdb.String(), number=hyperdb.Number(), | 90 string=hyperdb.String(), number=hyperdb.Number(), |
| 96 intval=hyperdb.Integer(), boolean=hyperdb.Boolean(), | 91 intval=hyperdb.Integer(), boolean=hyperdb.Boolean(), |
| 97 link=hyperdb.Link('test'), multilink=hyperdb.Multilink('test'), | 92 link=hyperdb.Link('test'), multilink=hyperdb.Multilink('test'), |
