Commit 7f575bb8 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_core_test testERP5Catalog: Assorted style improvements.

parent c06e2069
Pipeline #19896 failed with stage
in 0 seconds
...@@ -605,26 +605,21 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -605,26 +605,21 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
sql = """select creation_date, modification_date sql = """select creation_date, modification_date
from catalog where uid = %s""" % organisation.getUid() from catalog where uid = %s""" % organisation.getUid()
result = sql_connection.manage_test(sql) result = sql_connection.manage_test(sql)
self.assertEqual(creation_date, self.assertEqual(creation_date, result[0]['creation_date'].ISO())
result[0]['creation_date'].ISO()) self.assertEqual(modification_date, result[0]['modification_date'].ISO())
self.assertEqual(modification_date,
result[0]['modification_date'].ISO())
import time; time.sleep(3) import time; time.sleep(3)
organisation.edit(title='edited') organisation.edit(title='edited')
self.tic() self.tic()
result = sql_connection.manage_test(sql) result = sql_connection.manage_test(sql)
self.assertEqual(creation_date, result[0]['creation_date'].ISO()) self.assertEqual(creation_date, result[0]['creation_date'].ISO())
modification_date = organisation.getModificationDate().toZone('UTC').ISO() modification_date = organisation.getModificationDate().toZone('UTC').ISO()
self.assertNotEquals(modification_date, self.assertNotEqual(modification_date, organisation.getCreationDate())
organisation.getCreationDate())
# This test was first written with a now variable initialized with # This test was first written with a now variable initialized with
# DateTime(). But since we are never sure of the time required in # DateTime(). But since we are never sure of the time required in
# order to execute some line of code # order to execute some line of code
self.assertEqual(modification_date, self.assertEqual(modification_date, result[0]['modification_date'].ISO())
result[0]['modification_date'].ISO()) self.assertGreater(organisation.getModificationDate(), now)
self.assertTrue(organisation.getModificationDate()>now) self.assertLesser(result[0]['creation_date'], result[0]['modification_date'])
self.assertTrue(result[0]['creation_date']<result[0]['modification_date'])
def test_19_SearchFolderWithNonAsciiCharacter(self): def test_19_SearchFolderWithNonAsciiCharacter(self):
person_module = self.getPersonModule() person_module = self.getPersonModule()
......
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