Skip to content

Commit

Permalink
Merge pull request #713 from praekeltfoundation/endline_fixes
Browse files Browse the repository at this point in the history
add next step after endline not interested
  • Loading branch information
Hlamallama authored Nov 20, 2023
2 parents 087869a + b726ad3 commit 86f7ab3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yal/assessments.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ async def state_not_interested(self):
Choice("menu", self._("Go to the menu")),
Choice("aaq", self._("Ask a question")),
],
next=None,
next={
"menu": "state_pre_mainmenu",
"aaq": AAQApplication.START_STATE,
},
error=self._(get_generic_error()),
)

Expand Down
13 changes: 13 additions & 0 deletions yal/tests/test_assessments.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,3 +622,16 @@ async def test_state_assessment_later_submit_endline(tester: AppTester):
tester.setup_state("state_assessment_later_submit")

tester.assert_metadata("assessment_reminder_name", "locus_of_control_endline")


@pytest.mark.asyncio
async def test_whatsapp_menu_after_not_interested(tester: AppTester, rapidpro_mock):
tester.user.metadata["terms_accepted"] = "True"
tester.user.metadata["onboarding_completed"] = "True"
tester.user.metadata["endline_survey_started"] = "not_interested"

tester.setup_state("state_not_interested")

await tester.user_input("menu")

tester.assert_state("state_mainmenu")

0 comments on commit 86f7ab3

Please sign in to comment.