test two different wfs may have a state of the same name 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 25 Aug 2009 13:32:33 +0200
branch3.5
changeset 2979 94277323239d
parent 2978 d8c5ad14ab8e
child 2980 292387ed37f3
test two different wfs may have a state of the same name
entities/test/unittest_wfobjs.py
--- a/entities/test/unittest_wfobjs.py	Tue Aug 25 12:38:37 2009 +0200
+++ b/entities/test/unittest_wfobjs.py	Tue Aug 25 13:32:33 2009 +0200
@@ -31,10 +31,15 @@
     def test_duplicated_state(self):
         wf = add_wf(self, 'Company')
         wf.add_state(u'foo', initial=True)
+        self.commit()
         wf.add_state(u'foo')
         ex = self.assertRaises(ValidationError, self.commit)
         # XXX enhance message
         self.assertEquals(ex.errors, {'state_of': 'unique constraint S name N, Y state_of O, Y name N failed'})
+        # no pb if not in the same workflow
+        wf2 = add_wf(self, 'Company')
+        foo = wf2.add_state(u'foo', initial=True)
+        self.commit()
 
     def test_duplicated_transition(self):
         wf = add_wf(self, 'Company')