Commit ab02ed64 authored by Jérome Perrin's avatar Jérome Perrin

wip

parent d7dbec65
...@@ -464,11 +464,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -464,11 +464,10 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
return row.title return row.title
modified_title = getTitleFromCatalog() + '_not_reindexed' modified_title = getTitleFromCatalog() + '_not_reindexed'
catalog_connection = self.getSQLConnection()() catalog_connection = self.getSQLConnection()()
catalog_connection.query(bytes( catalog_connection.query(
'UPDATE catalog SET title=%s WHERE uid=%i' % ( b'UPDATE catalog SET title=%s WHERE uid=%i' % (
catalog_connection.string_literal(modified_title), catalog_connection.string_literal(modified_title),
person_object.getUid(), person_object.getUid(),
),
)) ))
self.commit() self.commit()
# sanity check # sanity check
...@@ -2381,7 +2380,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2381,7 +2380,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
foo.getRegionList()) foo.getRegionList())
# using relations to non existant objects will issue a warning in # using relations to non existant objects will issue a warning in
# event.log # event.log
self._catch_log_errors(ignored_level=sys.maxint) self._catch_log_errors(ignored_level=2**32)
self.assertEqual([beta], self.assertEqual([beta],
foo.getRegionValueList()) foo.getRegionValueList())
self.assertEqual([beta_title], self.assertEqual([beta_title],
......
...@@ -1613,7 +1613,7 @@ class SimulationTool(BaseTool): ...@@ -1613,7 +1613,7 @@ class SimulationTool(BaseTool):
line_key = getInventoryListKey(line) line_key = getInventoryListKey(line)
line_a = inventory_list_dict.get(line_key) line_a = inventory_list_dict.get(line_key)
inventory_list_dict[line_key] = addLineValues(line_a, line) inventory_list_dict[line_key] = addLineValues(line_a, line)
sorted_inventory_list = inventory_list_dict.values() sorted_inventory_list = list(inventory_list_dict.values())
# Sort results manually when required # Sort results manually when required
sort_on = new_kw.get('sort_on') sort_on = new_kw.get('sort_on')
if sort_on: if sort_on:
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
TODO: test variation TODO: test variation
test selection_report test selection_report
""" """
from __future__ import division
import os import os
import random import random
import unittest import unittest
...@@ -2974,7 +2974,7 @@ class TestInventoryCacheTable(InventoryAPITestCase): ...@@ -2974,7 +2974,7 @@ class TestInventoryCacheTable(InventoryAPITestCase):
def afterSetUp(self): def afterSetUp(self):
InventoryAPITestCase.afterSetUp(self) InventoryAPITestCase.afterSetUp(self)
self.CACHE_LAG = cache_lag = self.getSimulationTool().getInventoryCacheLag() self.CACHE_LAG = cache_lag = self.getSimulationTool().getInventoryCacheLag()
min_lag = cache_lag / 2 min_lag = cache_lag // 2
self.NOW = now = DateTime(DateTime().strftime("%Y-%m-%d %H:%M:%S UTC")) self.NOW = now = DateTime(DateTime().strftime("%Y-%m-%d %H:%M:%S UTC"))
self.CACHE_DATE = cache_date = now - min_lag self.CACHE_DATE = cache_date = now - min_lag
from erp5.component.tool.SimulationTool import MYSQL_MIN_DATETIME_RESOLUTION from erp5.component.tool.SimulationTool import MYSQL_MIN_DATETIME_RESOLUTION
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment