[dataimport] prepare_insert_entity should not crash with SQLGenObjectStore
authorSamuel Trégouët <samuel.tregouet@logilab.fr>
Thu, 03 Dec 2015 14:55:10 +0100
changeset 10984 a42f6e7cef35
parent 10983 da8168612e61
child 10985 50ed87bc4cc6
[dataimport] prepare_insert_entity should not crash with SQLGenObjectStore grafted from 1079d68130e1e780791ceb2050e8a8b7a910f48d (3.22) related to #9177565.
dataimport/test/test_pgstore.py
--- a/dataimport/test/test_pgstore.py	Tue Dec 01 13:39:17 2015 +0100
+++ b/dataimport/test/test_pgstore.py	Thu Dec 03 14:55:10 2015 +0100
@@ -23,6 +23,7 @@
 from logilab.common.testlib import TestCase, unittest_main
 
 from cubicweb.dataimport import pgstore
+from cubicweb.devtools import testlib
 
 
 class CreateCopyFromBufferTC(TestCase):
@@ -88,5 +89,16 @@
         expected = '''42\téléphant\n6\tbabar'''
         self.assertMultiLineEqual(expected, results.getvalue())
 
+
+class SQLGenObjectStoreTC(testlib.CubicWebTC):
+
+    def test_prepare_insert_entity(self):
+        with self.admin_access.repo_cnx() as cnx:
+            store = pgstore.SQLGenObjectStore(cnx)
+            eid = store.prepare_insert_entity('CWUser', login=u'toto',
+                                              upassword=u'pwd')
+            self.assertIsNotNone(eid)
+
+
 if __name__ == '__main__':
     unittest_main()