[FIX] statusbar widget: fix no value display for 'selection' field
[odoo/odoo.git] / addons / web / cli / test_js.py
1 import logging
2 import optparse
3 import sys
4
5 import unittest2
6
7 import openerp
8 import openerp.addons.web.tests
9
10 _logger = logging.getLogger(__name__)
11
12 class TestJs(openerp.cli.Command):
13     def run(self, args):
14         self.parser = parser = optparse.OptionParser()
15         parser.add_option("-d", "--database", dest="db_name", default=False, help="specify the database name")
16         parser.add_option("--xmlrpc-port", dest="xmlrpc_port", default=8069, help="specify the TCP port for the XML-RPC protocol", type="int")
17         # proably need to add both --superadmin-password and --database-admin-password
18         self.parser.parse_args(args)
19
20         # test ony uses db_name xmlrpc_port admin_passwd, so use the server one for the actual parsing
21
22         config = openerp.tools.config
23         config.parse_config(args)
24         # needed until runbot is fixed
25         config['db_password'] = config['admin_passwd']
26
27         # run js tests
28         openerp.netsvc.init_alternative_logger()
29         suite = unittest2.TestSuite()
30         suite.addTests(unittest2.TestLoader().loadTestsFromModule(openerp.addons.web.tests.test_js))
31         r = unittest2.TextTestRunner(verbosity=2).run(suite)
32         if r.errors or r.failures:
33             sys.exit(1)
34
35 # vim:et:ts=4:sw=4: