[tests] fix test after absolute_url got changed for external entities stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Fri, 22 May 2009 01:30:58 +0200
branchstable
changeset 1905 9c96dd7cc624
parent 1904 e23536d29231
child 1906 7c266edf28bd
child 1907 0f3363d24239
[tests] fix test after absolute_url got changed for external entities
test/unittest_entity.py
--- a/test/unittest_entity.py	Fri May 22 01:30:20 2009 +0200
+++ b/test/unittest_entity.py	Fri May 22 01:30:58 2009 +0200
@@ -374,14 +374,15 @@
         self.assertEquals(person.prenom, u'sylvain')
         self.assertEquals(person.nom, u'thénault')
 
-    def test_metainformation(self):
+    def test_metainformation_and_external_absolute_url(self):
         note = self.add_entity('Note', type=u'z')
         metainf = note.metainformation()
         self.assertEquals(metainf, {'source': {'adapter': 'native', 'uri': 'system'}, 'type': u'Note', 'extid': None})
         self.assertEquals(note.absolute_url(), 'http://testing.fr/cubicweb/note/%s' % note.eid)
         metainf['source'] = metainf['source'].copy()
         metainf['source']['base-url']  = 'http://cubicweb2.com/'
-        self.assertEquals(note.absolute_url(), 'http://cubicweb2.com/note/%s' % note.eid)
+        metainf['extid']  = 1234
+        self.assertEquals(note.absolute_url(), 'http://cubicweb2.com/note/1234')
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main