diff --git a/openerp/tests/common.py b/openerp/tests/common.py
index 4bd4d069f3f..0ae5adafaf6 100644
--- a/openerp/tests/common.py
+++ b/openerp/tests/common.py
@@ -297,8 +297,12 @@ class HttpCase(TransactionCase):
buf.append(s)
# process lines
- if '\n' in buf:
- line, buf = buf.split('\n', 1)
+ if '\n' in buf and (not buf.startswith('') or '' in buf):
+ if buf.startswith(''):
+ line = buf[12:buf.index('')]
+ buf = bytearray()
+ else:
+ line, buf = buf.split('\n', 1)
line = str(line)
# relay everything from console.log, even 'ok' or 'error...' lines
diff --git a/openerp/tests/phantomtest.js b/openerp/tests/phantomtest.js
index 4f264118485..d61d47c9847 100644
--- a/openerp/tests/phantomtest.js
+++ b/openerp/tests/phantomtest.js
@@ -57,7 +57,7 @@ function PhantomTest() {
phantom.exit(1);
};
this.page.onConsoleMessage = function(message) {
- console.log(message);
+ console.log(''+message+'');
};
this.page.onLoadFinished = function(status) {
if (status === "success") {
@@ -92,7 +92,7 @@ function PhantomTest() {
var message = ("Timeout\nhref: " + window.location.href +
"\nreferrer: " + document.referrer +
"\n\n" + (document.body && document.body.innerHTML)).replace(/[^a-z0-9\s~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "*");
- console.log('error', message);
+ console.log('error ' + message + '');
phantom.exit(1);
});
}, self.timeout);