def test_that_step_string_get_the_poll_translation(self):
        registration_steps_view = RegistrationStepsView()
        settings.REGISTRATION_SCRIPTS = {"ureport_autoreg2": "en", "ureport_autoreg_luo2": "ach"}

        poll_step = self.get_mocked_step_with_poll_question("expected question","ureport_autoreg2")
        poll_luo_step = self.get_mocked_step_with_poll_question("luo question", "ureport_autoreg_luo2")
        Translation.objects.get_or_create(field="luo question", language="ach", value="translated luo question")
        step_message = self.get_mocked_step_with_message("expected message")
        steps = [poll_step, step_message, poll_luo_step]

        steps_strings = registration_steps_view.get_step_strings(steps)

        self.assertItemsEqual([u'expected question', u'expected message', u'translated luo question'], steps_strings)
Exemplo n.º 2
0
    def test_that_step_string_get_the_poll_translation(self):
        registration_steps_view = RegistrationStepsView()
        settings.REGISTRATION_SCRIPTS = {
            "ureport_autoreg2": "en",
            "ureport_autoreg_luo2": "ach"
        }

        poll_step = self.get_mocked_step_with_poll_question(
            "expected question", "ureport_autoreg2")
        poll_luo_step = self.get_mocked_step_with_poll_question(
            "luo question", "ureport_autoreg_luo2")
        Translation.objects.get_or_create(field="luo question",
                                          language="ach",
                                          value="translated luo question")
        step_message = self.get_mocked_step_with_message("expected message")
        steps = [poll_step, step_message, poll_luo_step]

        steps_strings = registration_steps_view.get_step_strings(steps)

        self.assertItemsEqual([
            u'expected question', u'expected message',
            u'translated luo question'
        ], steps_strings)