cubicweb/test/unittest_entity.py
changeset 12508 a8c1ea390400
parent 11891 67185e65f020
child 12567 26744ad37953
equal deleted inserted replaced
12507:211472ab15c8 12508:a8c1ea390400
   835             note.cw_set(ecrit_par=person)
   835             note.cw_set(ecrit_par=person)
   836             note = req.create_entity('Note', type=u'y')
   836             note = req.create_entity('Note', type=u'y')
   837             note.cw_set(ecrit_par=person.eid)
   837             note.cw_set(ecrit_par=person.eid)
   838             self.assertEqual(len(person.reverse_ecrit_par), 2)
   838             self.assertEqual(len(person.reverse_ecrit_par), 2)
   839 
   839 
   840     def test_metainformation(self):
       
   841         with self.admin_access.client_cnx() as cnx:
       
   842             note = cnx.create_entity('Note', type=u'z')
       
   843             cnx.commit()
       
   844             note.cw_clear_all_caches()
       
   845             metainf = note.cw_metainformation()
       
   846             self.assertEqual(metainf, {'type': u'Note',
       
   847                                        'extid': None,
       
   848                                        'source': {'uri': 'system'}})
       
   849 
       
   850     def test_absolute_url_empty_field(self):
   840     def test_absolute_url_empty_field(self):
   851         with self.admin_access.web_request() as req:
   841         with self.admin_access.web_request() as req:
   852             card = req.create_entity('Card', wikiid=u'', title=u'test')
   842             card = req.create_entity('Card', wikiid=u'', title=u'test')
   853             self.assertEqual(card.absolute_url(),
   843             self.assertEqual(card.absolute_url(),
   854                               'http://testing.fr/cubicweb/%s' % card.eid)
   844                               'http://testing.fr/cubicweb/%s' % card.eid)