diff 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
line wrap: on
line diff
--- a/test/test_cgi.py	Tue Mar 30 09:10:46 2021 +0200
+++ b/test/test_cgi.py	Tue Mar 30 14:16:28 2021 +0200
@@ -21,6 +21,7 @@
 from roundup.cgi.form_parser import FormParser
 from roundup import init, instance, password, hyperdb, date
 from roundup.anypy.strings import u2s, b2s, s2b
+from roundup.test.tx_Source_detector import init as tx_Source_init
 
 from time import sleep
 
@@ -83,13 +84,7 @@
     def setUp(self):
         FormTestParent.setUp(self)
 
-        vars = {}
-        thisdir = os.path.dirname(__file__)
-        exec(compile(open(os.path.join(thisdir,
-                                       "tx_Source_detector.py")).read(),
-                     os.path.join(thisdir, "tx_Source_detector.py"), 'exec'),
-             vars)
-        vars['init'](self.db)
+        tx_Source_init(self.db)
 
         test = self.instance.backend.Class(self.db, "test",
             string=hyperdb.String(), number=hyperdb.Number(),

Roundup Issue Tracker: http://roundup-tracker.org/