[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'),
|
'date_to': fields.date('End Date'),
|
||||||
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
|
'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),
|
'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'
|
_order = 'dayofweek, hour_from'
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ class HttpCase(TransactionCase):
|
|||||||
_logger.info("phantomjs: %s", line)
|
_logger.info("phantomjs: %s", line)
|
||||||
|
|
||||||
if line == "ok":
|
if line == "ok":
|
||||||
break
|
return True
|
||||||
|
|
||||||
def phantom_run(self, cmd, timeout):
|
def phantom_run(self, cmd, timeout):
|
||||||
_logger.info('phantom_run executing %s', ' '.join(cmd))
|
_logger.info('phantom_run executing %s', ' '.join(cmd))
|
||||||
@@ -375,8 +375,9 @@ class HttpCase(TransactionCase):
|
|||||||
phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None)
|
phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None)
|
||||||
except OSError:
|
except OSError:
|
||||||
raise unittest.SkipTest("PhantomJS not found")
|
raise unittest.SkipTest("PhantomJS not found")
|
||||||
|
result = False
|
||||||
try:
|
try:
|
||||||
self.phantom_poll(phantom, timeout)
|
result = self.phantom_poll(phantom, timeout)
|
||||||
finally:
|
finally:
|
||||||
# kill phantomjs if phantom.exit() wasn't called in the test
|
# kill phantomjs if phantom.exit() wasn't called in the test
|
||||||
if phantom.poll() is None:
|
if phantom.poll() is None:
|
||||||
@@ -385,6 +386,10 @@ class HttpCase(TransactionCase):
|
|||||||
self._wait_remaining_requests()
|
self._wait_remaining_requests()
|
||||||
# we ignore phantomjs return code as we kill it as soon as we have ok
|
# we ignore phantomjs return code as we kill it as soon as we have ok
|
||||||
_logger.info("phantom_run execution finished")
|
_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):
|
def _wait_remaining_requests(self):
|
||||||
t0 = int(time.time())
|
t0 = int(time.time())
|
||||||
|
|||||||
Reference in New Issue
Block a user