[MERGE] forward port branch saas-6 up to 1d00e32
This commit is contained in:
@@ -643,7 +643,7 @@ class resource_calendar_attendance(osv.osv):
|
||||
'date_to': fields.date('End Date'),
|
||||
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
|
||||
'hour_to' : fields.float("Work to", required=True),
|
||||
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True),
|
||||
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True, ondelete='cascade'),
|
||||
}
|
||||
|
||||
_order = 'dayofweek, hour_from'
|
||||
|
||||
@@ -362,7 +362,7 @@ class HttpCase(TransactionCase):
|
||||
_logger.info("phantomjs: %s", line)
|
||||
|
||||
if line == "ok":
|
||||
break
|
||||
return True
|
||||
|
||||
def phantom_run(self, cmd, timeout):
|
||||
_logger.info('phantom_run executing %s', ' '.join(cmd))
|
||||
@@ -375,8 +375,9 @@ class HttpCase(TransactionCase):
|
||||
phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None)
|
||||
except OSError:
|
||||
raise unittest.SkipTest("PhantomJS not found")
|
||||
result = False
|
||||
try:
|
||||
self.phantom_poll(phantom, timeout)
|
||||
result = self.phantom_poll(phantom, timeout)
|
||||
finally:
|
||||
# kill phantomjs if phantom.exit() wasn't called in the test
|
||||
if phantom.poll() is None:
|
||||
@@ -385,6 +386,10 @@ class HttpCase(TransactionCase):
|
||||
self._wait_remaining_requests()
|
||||
# we ignore phantomjs return code as we kill it as soon as we have ok
|
||||
_logger.info("phantom_run execution finished")
|
||||
self.assertTrue(
|
||||
result,
|
||||
"PhantomJS test completed without reporting success; "
|
||||
"the log may contain errors or hints.")
|
||||
|
||||
def _wait_remaining_requests(self):
|
||||
t0 = int(time.time())
|
||||
|
||||
Reference in New Issue
Block a user