equal
deleted
inserted
replaced
851 req = self.request() |
851 req = self.request() |
852 p1 = req.create_entity('Personne', nom=u'Vincent') |
852 p1 = req.create_entity('Personne', nom=u'Vincent') |
853 p2 = req.create_entity('Personne', nom=u'Florent') |
853 p2 = req.create_entity('Personne', nom=u'Florent') |
854 w = req.create_entity('Affaire', ref=u'wc') |
854 w = req.create_entity('Affaire', ref=u'wc') |
855 w.set_relations(todo_by=[p1,p2]) |
855 w.set_relations(todo_by=[p1,p2]) |
856 w.clear_all_caches() |
856 w.cw_clear_all_caches() |
857 self.commit() |
857 self.commit() |
858 self.assertEqual(len(w.todo_by), 1) |
858 self.assertEqual(len(w.todo_by), 1) |
859 self.assertEqual(w.todo_by[0].eid, p2.eid) |
859 self.assertEqual(w.todo_by[0].eid, p2.eid) |
860 |
860 |
861 def test_optional_relation_reset_2(self): |
861 def test_optional_relation_reset_2(self): |
864 p2 = req.create_entity('Personne', nom=u'Florent') |
864 p2 = req.create_entity('Personne', nom=u'Florent') |
865 w = req.create_entity('Affaire', ref=u'wc') |
865 w = req.create_entity('Affaire', ref=u'wc') |
866 w.set_relations(todo_by=p1) |
866 w.set_relations(todo_by=p1) |
867 self.commit() |
867 self.commit() |
868 w.set_relations(todo_by=p2) |
868 w.set_relations(todo_by=p2) |
869 w.clear_all_caches() |
869 w.cw_clear_all_caches() |
870 self.commit() |
870 self.commit() |
871 self.assertEqual(len(w.todo_by), 1) |
871 self.assertEqual(len(w.todo_by), 1) |
872 self.assertEqual(w.todo_by[0].eid, p2.eid) |
872 self.assertEqual(w.todo_by[0].eid, p2.eid) |
873 |
873 |
874 |
874 |