dataimport/test/unittest_importer.py
changeset 11275 814f54d6183b
parent 11110 68477666401f
--- a/dataimport/test/unittest_importer.py	Wed Jun 01 15:36:18 2016 +0200
+++ b/dataimport/test/unittest_importer.py	Wed May 04 23:52:36 2016 +0200
@@ -126,6 +126,19 @@
             self.assertEqual(entity.nom, u'Richelieu')
             self.assertEqual(len(entity.connait), 0)
 
+    def test_import_order(self):
+        """Check import of ext entity in both order"""
+        with self.admin_access.repo_cnx() as cnx:
+            importer = self.importer(cnx)
+            richelieu = ExtEntity('Personne', 3, {'nom': set([u'Richelieu']),
+                                                  'enfant': set([4])})
+            athos = ExtEntity('Personne', 4, {'nom': set([u'Athos'])})
+            importer.import_entities([richelieu, athos])
+            cnx.commit()
+            rset = cnx.execute('Any X WHERE X is Personne, X nom "Richelieu"')
+            entity = rset.get_entity(0, 0)
+            self.assertEqual(entity.enfant[0].nom, 'Athos')
+
     def test_update(self):
         """Check update of ext entity"""
         with self.admin_access.repo_cnx() as cnx: