dataimport/test/test_pgstore.py
changeset 10987 a945fe89b33f
parent 10984 a42f6e7cef35
equal deleted inserted replaced
10986:ca8321b32392 10987:a945fe89b33f
    21 import datetime as DT
    21 import datetime as DT
    22 
    22 
    23 from logilab.common.testlib import TestCase, unittest_main
    23 from logilab.common.testlib import TestCase, unittest_main
    24 
    24 
    25 from cubicweb.dataimport import pgstore
    25 from cubicweb.dataimport import pgstore
    26 from cubicweb.devtools import testlib
       
    27 
    26 
    28 
    27 
    29 class CreateCopyFromBufferTC(TestCase):
    28 class CreateCopyFromBufferTC(TestCase):
    30 
    29 
    31     # test converters
    30     # test converters
    88         results = pgstore._create_copyfrom_buffer(data, ('integer', 'text'))
    87         results = pgstore._create_copyfrom_buffer(data, ('integer', 'text'))
    89         expected = '''42\téléphant\n6\tbabar'''
    88         expected = '''42\téléphant\n6\tbabar'''
    90         self.assertMultiLineEqual(expected, results.getvalue())
    89         self.assertMultiLineEqual(expected, results.getvalue())
    91 
    90 
    92 
    91 
    93 class SQLGenObjectStoreTC(testlib.CubicWebTC):
       
    94 
       
    95     def test_prepare_insert_entity(self):
       
    96         with self.admin_access.repo_cnx() as cnx:
       
    97             store = pgstore.SQLGenObjectStore(cnx)
       
    98             eid = store.prepare_insert_entity('CWUser', login=u'toto',
       
    99                                               upassword=u'pwd')
       
   100             self.assertIsNotNone(eid)
       
   101 
       
   102 
       
   103 if __name__ == '__main__':
    92 if __name__ == '__main__':
   104     unittest_main()
    93     unittest_main()