entities/test/unittest_wfobjs.py
branch3.5
changeset 2979 94277323239d
parent 2977 6dd4f4a3ff2a
child 2982 1768dbe8e9b3
--- 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')