def test_that_retrieves_last_step_for_a_script_progress_that_is_in_last_step( self): view = ViewCurrentPoll() backend = Backend.objects.create(name="test_backend") connection = Connection.objects.create(identity="7777", backend=backend) script, created = Script.objects.get_or_create(slug="ureport_autoreg2") first_step = ScriptStep.objects.create(script=script, order=1) second_step = ScriptStep.objects.create(script=script, order=2) third_step = ScriptStep.objects.create(script=script, order=3) script_progress = ScriptProgress.objects.create(connection=connection, script=script, step=third_step) self.assertEqual(third_step, view.get_current_step(script_progress))
def setUp(self): self.view = ViewCurrentPoll()