test/unittest_entity.py
branchstable
changeset 9214 be05b42b4825
parent 9160 7db0c75acf1c
child 9261 1dfe62a9da50
child 9273 f3795da61959
equal deleted inserted replaced
9213:312062f53981 9214:be05b42b4825
   690         # ambiguity test
   690         # ambiguity test
   691         person2 = req.create_entity('Personne', prenom=u'remi', nom=u'doe')
   691         person2 = req.create_entity('Personne', prenom=u'remi', nom=u'doe')
   692         person.cw_clear_all_caches()
   692         person.cw_clear_all_caches()
   693         self.assertEqual(person.rest_path(), unicode(person.eid))
   693         self.assertEqual(person.rest_path(), unicode(person.eid))
   694         self.assertEqual(person2.rest_path(), unicode(person2.eid))
   694         self.assertEqual(person2.rest_path(), unicode(person2.eid))
   695         # unique attr with None value (wikiid in this case)
   695         # unique attr with None value (nom in this case)
   696         card1 = req.create_entity('Card', title=u'hop')
   696         friend = req.create_entity('Ami', prenom=u'bob')
   697         self.assertEqual(card1.rest_path(), unicode(card1.eid))
   697         self.assertEqual(friend.rest_path(), unicode(friend.eid))
   698         # don't use rest if we have /, ? or & in the path (breaks mod_proxy)
   698         # don't use rest if we have /, ? or & in the path (breaks mod_proxy)
   699         card2 = req.create_entity('Card', title=u'pod', wikiid=u'zo/bi')
   699         person3 = req.create_entity('Personne', nom=u'zo/bi')
   700         self.assertEqual(card2.rest_path(), unicode(card2.eid))
   700         self.assertEqual(person3.rest_path(), unicode(person3.eid))
   701         card3 = req.create_entity('Card', title=u'pod', wikiid=u'zo&bi')
   701         person4 = req.create_entity('Personne', nom=u'zo&bi')
   702         self.assertEqual(card3.rest_path(), unicode(card3.eid))
   702         self.assertEqual(person4.rest_path(), unicode(person4.eid))
   703         card4 = req.create_entity('Card', title=u'pod', wikiid=u'zo?bi')
   703         person5 = req.create_entity('Personne', nom=u'zo?bi')
   704         self.assertEqual(card4.rest_path(), unicode(card4.eid))
   704         self.assertEqual(person5.rest_path(), unicode(person5.eid))
   705 
   705 
   706 
   706 
   707     def test_cw_set_attributes(self):
   707     def test_cw_set_attributes(self):
   708         req = self.request()
   708         req = self.request()
   709         person = req.create_entity('Personne', nom=u'di mascio', prenom=u'adrien')
   709         person = req.create_entity('Personne', nom=u'di mascio', prenom=u'adrien')