# HG changeset patch # User Samuel Trégouët # Date 1449150910 -3600 # Node ID a42f6e7cef35ab161017d19cdf6589eaac0e0b31 # Parent da8168612e61d7237177626326f6743588a1eaf1 [dataimport] prepare_insert_entity should not crash with SQLGenObjectStore grafted from 1079d68130e1e780791ceb2050e8a8b7a910f48d (3.22) related to #9177565. diff -r da8168612e61 -r a42f6e7cef35 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()