Skip to content

Commit

Permalink
change group count value to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Nov 22, 2023
1 parent 6e5ee69 commit a1b9027
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion yal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def process_message(self, message):
group_name="Endline Survey Completed"
)

if int(group_count) >= int(endline_study_max_participant_count):
if group_count >= int(endline_study_max_participant_count):
return await self.go_to_state(
EndlineTermsApplication.ENDLINE_LIMIT_REACHED_STATE
)
Expand Down
8 changes: 4 additions & 4 deletions yal/tests/surveys/test_endline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_rapidpro_contact(urn):


def get_rapidpro_group(name):
return {"count": "100"}
return {"count": 100}


@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -114,7 +114,7 @@ async def test_endline_invitation_i_want_to_answer(
get_group_membership_count, tester: AppTester, rapidpro_mock
):

get_group_membership_count.return_value = "100"
get_group_membership_count.return_value = 100

tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
Expand Down Expand Up @@ -188,7 +188,7 @@ async def test_endline_invitation_answer(
get_group_membership_count, tester: AppTester, rapidpro_mock
):

get_group_membership_count.return_value = "100"
get_group_membership_count.return_value = 100

tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
Expand Down Expand Up @@ -1294,7 +1294,7 @@ async def test_endline_flow(tester: AppTester, rapidpro_mock):
async def test_endline_agree_terms_and_condition(
get_group_membership_count, tester: AppTester, rapidpro_mock
):
get_group_membership_count.return_value = "100"
get_group_membership_count.return_value = 100
tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
tester.user.metadata["terms_accepted"] = True
Expand Down
12 changes: 6 additions & 6 deletions yal/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_aaq_response(answers, next=None, prev=None):


def get_rapidpro_group(name):
return {"count": "100"}
return {"count": 100}


@pytest.fixture
Expand Down Expand Up @@ -891,7 +891,7 @@ async def test_state_self_perceived_healthcare_assessment_later(
async def test_endline_survey_start_keywords(
get_group_membership_count, tester: AppTester, rapidpro_mock, contentrepo_api_mock
):
get_group_membership_count.return_value = "100"
get_group_membership_count.return_value = 100

rapidpro_mock.tstate.contact_fields["onboarding_completed"] = True
rapidpro_mock.tstate.contact_fields["terms_accepted"] = True
Expand Down Expand Up @@ -1593,7 +1593,7 @@ async def test_survey_invite_remind_me_tomorrow(
async def test_state_endline_limit_reached(
get_group_membership_count, tester: AppTester, rapidpro_mock
):
get_group_membership_count.return_value = "250"
get_group_membership_count.return_value = 250

tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
Expand All @@ -1609,7 +1609,7 @@ async def test_state_endline_limit_reached(
async def test_state_endline_limit_reached_menu(
get_group_membership_count, tester: AppTester, rapidpro_mock
):
get_group_membership_count.return_value = "250"
get_group_membership_count.return_value = 250

tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
Expand Down Expand Up @@ -1651,7 +1651,7 @@ async def test_state_endline_limit_reached_aaq(
mock_config, get_group_membership_count, tester: AppTester, rapidpro_mock
):
mock_config.AAQ_URL = "http://aaq-test.com"
get_group_membership_count.return_value = "250"
get_group_membership_count.return_value = 250

tester.user.metadata["baseline_survey_completed"] = True
tester.user.metadata["endline_survey_started"] = "Pending"
Expand Down Expand Up @@ -1683,4 +1683,4 @@ async def test_state_endline_limit_reached_aaq(

await tester.user_input("Ask a question")

tester.assert_state("state_aaq_start")
tester.assert_state("state_aaq_start")

0 comments on commit a1b9027

Please sign in to comment.