示例#1
0
    def test_get_final_states(self):
        self.initialize_normal_scenario()

        self.assertListEqual(
            list(
                State.objects.filter(
                    label__in=['s4.1', 's4.2', 's5.1', 's5.2'])),
            list(StateService.get_final_states(self.content_type)))
示例#2
0
        def on_final_state(self):
            from river.services.state import StateService

            return getattr(self, name) in StateService.get_final_states(
                ContentType.objects.get_for_model(self), name)
 def test_get_final_states(self):
     self.assertListEqual(
         list(
             State.objects.filter(
                 label__in=['s4.1', 's4.2', 's5.1', 's5.2'])),
         list(StateService.get_final_states(self.content_type, self.field)))
示例#4
0
        def on_final_state(self):
            from river.services.state import StateService

            return getattr(self, name) in StateService.get_final_states(ContentType.objects.get_for_model(self), name)
示例#5
0
 def test_get_final_states(self):
     self.assertListEqual(list(State.objects.filter(label__in=['s4.1', 's4.2', 's5.1', 's5.2'])), list(StateService.get_final_states(self.content_type, self.field)))
示例#6
0
 def get_final_approvements(content_type, field):
     final_states = StateService.get_final_states(content_type, field)
     return Approvement.objects.filter(meta__transition__destination_state__in=final_states, meta__transition__direction=FORWARD)
    def test_get_final_states(self):
        self.initialize_normal_scenario()

        self.assertListEqual(list(State.objects.filter(label__in=['s4.1', 's4.2', 's5.1', 's5.2'])), list(StateService.get_final_states(self.content_type)))