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)))
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)))
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)))
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)))