830 note = req.create_entity('Note', type=u'y') |
830 note = req.create_entity('Note', type=u'y') |
831 note.cw_set(ecrit_par=person.eid) |
831 note.cw_set(ecrit_par=person.eid) |
832 self.assertEqual(len(person.reverse_ecrit_par), 2) |
832 self.assertEqual(len(person.reverse_ecrit_par), 2) |
833 |
833 |
834 def test_metainformation(self): |
834 def test_metainformation(self): |
835 with self.admin_access.web_request() as req: |
835 with self.admin_access.client_cnx() as cnx: |
836 note = req.create_entity('Note', type=u'z') |
836 note = cnx.create_entity('Note', type=u'z') |
|
837 cnx.commit() |
|
838 note.cw_clear_all_caches() |
837 metainf = note.cw_metainformation() |
839 metainf = note.cw_metainformation() |
838 self.assertEqual(metainf, {'type': u'Note', 'extid': None}) |
840 self.assertEqual(metainf, {'type': u'Note', |
|
841 'extid': None, |
|
842 'source': {'uri': 'system'}}) |
839 |
843 |
840 def test_absolute_url_empty_field(self): |
844 def test_absolute_url_empty_field(self): |
841 with self.admin_access.web_request() as req: |
845 with self.admin_access.web_request() as req: |
842 card = req.create_entity('Card', wikiid=u'', title=u'test') |
846 card = req.create_entity('Card', wikiid=u'', title=u'test') |
843 self.assertEqual(card.absolute_url(), |
847 self.assertEqual(card.absolute_url(), |