summaryrefslogtreecommitdiff
path: root/addons/web/controllers/testing.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-10-30 08:46:15 +0100
committerXavier Morel <xmo@openerp.com>2012-10-30 08:46:15 +0100
commitd2cf844e7b2e447ce0c1502aa3a514056a6d7fb1 (patch)
tree536e1616d1ed3e85ce805a8cf544e669a2611bba /addons/web/controllers/testing.py
parent523f4a6e03e909156082f528acf4e50024e7b486 (diff)
[IMP] allow providing db-cloning info directly in URL for test runner
bzr revid: xmo@openerp.com-20121030074615-lt517w5t9fd9ppvh
Diffstat (limited to 'addons/web/controllers/testing.py')
-rw-r--r--addons/web/controllers/testing.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/controllers/testing.py b/addons/web/controllers/testing.py
index 9947f1e1ed5..95121f5b192 100644
--- a/addons/web/controllers/testing.py
+++ b/addons/web/controllers/testing.py
@@ -51,6 +51,7 @@ TESTING = Template(u"""<!DOCTYPE html>
<script src="/web/static/lib/qunit/qunit.js"></script>
<script type="text/javascript">
+ var oe_db_info = ${db_info};
// List of modules, each module is preceded by its dependencies
var oe_all_dependencies = ${dependencies};
QUnit.config.testTimeout = 10000;
@@ -130,10 +131,16 @@ class TestRunnerController(Controller):
for mod, tests in itertools.izip(sorted_mods, tests)
]
+ # if all three db_info parameters are present, send them to the page
+ db_info = dict((k, v) for k, v in kwargs.iteritems()
+ if k in ['source', 'supadmin', 'password'])
+ if len(db_info) != 3:
+ db_info = None
+
return TESTING.render(files=files, dependencies=json.dumps(
[name for name in sorted_mods
if module.get_module_resource(name, 'static')
- if manifests[name]['js']]))
+ if manifests[name]['js']]), db_info=json.dumps(db_info))
def load_manifest(self, name):
manifest = module.load_information_from_description_file(name)