dataimport/test/unittest_importer.py
changeset 11110 68477666401f
parent 10809 359cbdf3a515
child 11275 814f54d6183b
equal deleted inserted replaced
11109:c361260fe191 11110:68477666401f
   130         """Check update of ext entity"""
   130         """Check update of ext entity"""
   131         with self.admin_access.repo_cnx() as cnx:
   131         with self.admin_access.repo_cnx() as cnx:
   132             importer = self.importer(cnx)
   132             importer = self.importer(cnx)
   133             # First import
   133             # First import
   134             richelieu = ExtEntity('Personne', 11,
   134             richelieu = ExtEntity('Personne', 11,
   135                                   {'nom': {u'Richelieu Diacre'}})
   135                                   {'nom': set([u'Richelieu Diacre'])})
   136             importer.import_entities([richelieu])
   136             importer.import_entities([richelieu])
   137             cnx.commit()
   137             cnx.commit()
   138             rset = cnx.execute('Any X WHERE X is Personne')
   138             rset = cnx.execute('Any X WHERE X is Personne')
   139             entity = rset.get_entity(0, 0)
   139             entity = rset.get_entity(0, 0)
   140             self.assertEqual(entity.nom, u'Richelieu Diacre')
   140             self.assertEqual(entity.nom, u'Richelieu Diacre')
   141             # Second import
   141             # Second import
   142             richelieu = ExtEntity('Personne', 11,
   142             richelieu = ExtEntity('Personne', 11,
   143                                   {'nom': {u'Richelieu Cardinal'}})
   143                                   {'nom': set([u'Richelieu Cardinal'])})
   144             importer.import_entities([richelieu])
   144             importer.import_entities([richelieu])
   145             cnx.commit()
   145             cnx.commit()
   146             rset = cnx.execute('Any X WHERE X is Personne')
   146             rset = cnx.execute('Any X WHERE X is Personne')
   147             self.assertEqual(len(rset), 1)
   147             self.assertEqual(len(rset), 1)
   148             entity = rset.get_entity(0, 0)
   148             entity = rset.get_entity(0, 0)