diff --git a/openerp/tests/common.py b/openerp/tests/common.py index 6bef7384f0d..932c88ae41a 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -250,7 +250,7 @@ class HttpCase(TransactionCase): def url_open(self, url, data=None, timeout=10): if url.startswith('/'): - url = "http://localhost:%s%s" % (PORT, url) + url = "http://%s:%s%s" % (HOST, PORT, url) return self.opener.open(url, data, timeout) def authenticate(self, user, password): @@ -328,7 +328,7 @@ class HttpCase(TransactionCase): def phantom_run(self, cmd, timeout): _logger.info('phantom_run executing %s', ' '.join(cmd)) - ls_glob = os.path.expanduser('~/.qws/share/data/Ofi Labs/PhantomJS/http_localhost_%s.*'%PORT) + ls_glob = os.path.expanduser('~/.qws/share/data/Ofi Labs/PhantomJS/http_%s_%s.*' % (HOST, PORT)) for i in glob.glob(ls_glob): _logger.info('phantomjs unlink localstorage %s', i) os.unlink(i) diff --git a/openerp/tests/phantomtest.js b/openerp/tests/phantomtest.js index 51dfb721263..1654ee3871f 100644 --- a/openerp/tests/phantomtest.js +++ b/openerp/tests/phantomtest.js @@ -2,6 +2,7 @@ // jshint evil: true, loopfunc: true var system = require('system'); +var HOST = '127.0.0.1'; function waitFor (condition, callback, timeout, timeoutMessageCallback) { timeout = timeout || 10000; @@ -24,14 +25,14 @@ function PhantomTest() { this.options = JSON.parse(system.args[system.args.length-1]); this.inject = this.options.inject || []; this.timeout = this.options.timeout ? Math.round(parseFloat(this.options.timeout)*1000 - 5000) : 10000; - this.origin = 'http://localhost'; + this.origin = 'http://' + HOST; this.origin += this.options.port ? ':' + this.options.port : ''; // ---------------------------------------------------- // configure phantom and page // ---------------------------------------------------- phantom.addCookie({ - 'domain': 'localhost', + 'domain': HOST, 'name': 'session_id', 'value': this.options.session_id, });