コード例 #1
0
    def test_metromap_second_state(self):
        """After carrying out the first workflow transition, the first state is
        finished. If the workflow allows for it, the first transition could
        still be enabled. The second transition should be enabled.
        """
        mm_seq = IMetroMap(self.case).metromap_sequence
        first_state_id = mm_seq.keys()[0]
        first_transition = mm_seq[first_state_id]["transition_id"]
        api.content.transition(self.case, first_transition)

        mm_seq = IMetroMap(self.case).metromap_sequence
        self.assertTrue(mm_seq[first_state_id]["finished"])

        second_state_id = mm_seq.keys()[1]
        self.assertTrue(mm_seq[second_state_id]["enabled"])
        self.assertFalse(mm_seq[second_state_id]["finished"])
コード例 #2
0
 def test_metromap_initial_state(self):
     """A newly created Case is in the first workflow state. It can't be
     finished and it must be possible to change workflow state to the next
     state, so the first transition is enabled.
     """
     mm_seq = IMetroMap(self.case).metromap_sequence
     initial_state_id = mm_seq.keys()[0]
     self.assertTrue(mm_seq[initial_state_id]["enabled"])
     self.assertFalse(mm_seq[initial_state_id]["finished"])