diff --git a/yal/endline_terms_and_conditions.py b/yal/endline_terms_and_conditions.py index 73c95714..fd3f52eb 100644 --- a/yal/endline_terms_and_conditions.py +++ b/yal/endline_terms_and_conditions.py @@ -239,7 +239,7 @@ async def state_household_number_of_people(self): async def next_state(choice: Choice): if choice.value == "eight_more": - return "state_household_number_of_people_more" + return "state_household_number_of_people_eight_or_more" return "state_submit_terms_and_conditions_endline" return WhatsAppListState( diff --git a/yal/tests/test_endline_terms_and_condition.py b/yal/tests/test_endline_terms_and_condition.py index f3d6451c..05fb8a85 100644 --- a/yal/tests/test_endline_terms_and_condition.py +++ b/yal/tests/test_endline_terms_and_condition.py @@ -91,8 +91,6 @@ async def test_state_monthly_household_income_endline(tester: AppTester, rapidpr ) tester.assert_message(message) - tester.assert_message(message) - @pytest.mark.asyncio async def test_state_accept_consent_reminder(tester: AppTester, rapidpro_mock): @@ -144,11 +142,19 @@ async def test_state_household_number_of_people(tester: AppTester, rapidpro_mock @pytest.mark.asyncio async def test_state_household_number_of_people_more(tester: AppTester, rapidpro_mock): tester.setup_state("state_household_number_of_people") - await tester.user_input("7") - message = "\n".join(["◼️◽️◽️◽️", "-----", "", "*I'm my own boss.* 😎"]) + await tester.user_input("8") + message = "\n".join( + [ + "*Okay - you said there are 8 or more people in your household.*", + "*How many people (including yourself) live in the household now?" + " Don’t forget to include babies.*", + "(If you’re unsure - this counts as anyone sleeping the house" + "4 nights in the past week).", + ] + ) tester.assert_message(message) - tester.assert_state("state_survey_question") + tester.assert_state("state_household_number_of_people_eight_or_more") @pytest.mark.asyncio @@ -156,7 +162,7 @@ async def test_state_household_number_of_people_eight_or_more( tester: AppTester, rapidpro_mock ): tester.setup_state("state_household_number_of_people_eight_or_more") - await tester.user_input("1") + await tester.user_input("5") message = "\n".join(["◼️◽️◽️◽️", "-----", "", "*I'm my own boss.* 😎"]) tester.assert_message(message)