# HG changeset patch # User Samuel Trégouët # Date 1449150910 -3600 # Node ID 1079d68130e1e780791ceb2050e8a8b7a910f48d # Parent b089858c49a2806b6ea8a7ee66773436701e947c [dataimport] prepare_insert_entity should not crash with SQLGenObjectStore diff -r b089858c49a2 -r 1079d68130e1 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 @@ -24,6 +24,7 @@ from logilab.common.testlib import TestCase, unittest_main from cubicweb.dataimport import pgstore +from cubicweb.devtools import testlib class CreateCopyFromBufferTC(TestCase): @@ -90,5 +91,16 @@ expected = u'''42\téléphant\n6\tbabar''' self.assertEqual(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()