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

wip

parent e0eb21c6
......@@ -464,12 +464,11 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
return row.title
modified_title = getTitleFromCatalog() + '_not_reindexed'
catalog_connection = self.getSQLConnection()()
catalog_connection.query(bytes(
'UPDATE catalog SET title=%s WHERE uid=%i' % (
catalog_connection.query(
b'UPDATE catalog SET title=%s WHERE uid=%i' % (
catalog_connection.string_literal(modified_title),
person_object.getUid(),
),
))
))
self.commit()
# sanity check
self.assertEqual(getTitleFromCatalog(), modified_title)
......@@ -2381,7 +2380,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
foo.getRegionList())
# using relations to non existant objects will issue a warning in
# event.log
self._catch_log_errors(ignored_level=sys.maxint)
self._catch_log_errors(ignored_level=2**32)
self.assertEqual([beta],
foo.getRegionValueList())
self.assertEqual([beta_title],
......
......@@ -1613,7 +1613,7 @@ class SimulationTool(BaseTool):
line_key = getInventoryListKey(line)
line_a = inventory_list_dict.get(line_key)
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_on = new_kw.get('sort_on')
if sort_on:
......
......@@ -31,7 +31,7 @@
TODO: test variation
test selection_report
"""
from __future__ import division
import os
import random
import unittest
......@@ -2974,7 +2974,7 @@ class TestInventoryCacheTable(InventoryAPITestCase):
def afterSetUp(self):
InventoryAPITestCase.afterSetUp(self)
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.CACHE_DATE = cache_date = now - min_lag
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