dataimport/test/test_massive_store.py
changeset 10855 cd91f46fa633
parent 10853 de741492538d
child 10857 aa490912d9da
--- a/dataimport/test/test_massive_store.py	Wed Oct 21 20:15:06 2015 +0200
+++ b/dataimport/test/test_massive_store.py	Wed Oct 21 20:16:41 2015 +0200
@@ -192,20 +192,20 @@
     def test_on_commit_callback(self):
         counter = itertools.count()
         with self.admin_access.repo_cnx() as cnx:
-            store = MassiveObjectStore(cnx, on_commit_callback=counter.next)
+            store = MassiveObjectStore(cnx, on_commit_callback=lambda:next(counter))
             store.create_entity('Location', name=u'toto')
             store.flush()
             store.commit()
-        self.assertTrue(counter.next() >= 1)
+        self.assertGreaterEqual(next(counter), 1)
 
     def test_on_rollback_callback(self):
         counter = itertools.count()
         with self.admin_access.repo_cnx() as cnx:
-            store = MassiveObjectStore(cnx, on_rollback_callback=lambda *_: counter.next())
+            store = MassiveObjectStore(cnx, on_rollback_callback=lambda *_: next(counter))
             store.create_entity('Location', nm='toto')
             store.flush()
             store.commit()
-        self.assertTrue(counter.next() >= 1)
+        self.assertGreaterEqual(next(counter), 1)
 
     def test_slave_mode_indexes(self):
         with self.admin_access.repo_cnx() as cnx: