Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests after vote service update #2844

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/system/action/poll/poll_test_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def prepare_users_and_poll(self, user_count: int) -> list[int]:
"option_ids": [1],
"meeting_id": 1,
"entitled_group_ids": [3],
"sequential_number": 1,
"onehundred_percent_base": "YNA",
"title": "Poll 1",
},
"option/1": {"meeting_id": 1, "poll_id": 1},
**{
Expand Down
3 changes: 3 additions & 0 deletions tests/system/action/poll/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def setUp(self) -> None:
"state": "finished",
"meeting_id": 1,
"content_object_id": "topic/1",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "YNA",
},
"topic/1": {"meeting_id": 1},
"meeting/1": {"is_active_in_organization_id": 1},
Expand Down
5 changes: 5 additions & 0 deletions tests/system/action/poll/test_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ def test_reset_not_allowed_to_vote_again(self) -> None:
"max_votes_per_option": 1,
"type": "named",
"backend": "long",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "Y",
"content_object_id": "topic/1",
},
"topic/1": {"meeting_id": 1, "poll_ids": [1], "title": "Tim the topic"},
}
)
self.vote_service.start(1)
Expand Down
2 changes: 2 additions & 0 deletions tests/system/action/poll/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def setUp(self) -> None:
"votescast": "0.000000",
"backend": "fast",
**self.get_poll_data(),
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
}
)
Expand Down
21 changes: 21 additions & 0 deletions tests/system/action/poll/test_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def setUp(self) -> None:
"content_object_id": "topic/1",
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "Y",
},
"meeting/1": {"is_active_in_organization_id": 1},
}
Expand All @@ -43,6 +46,9 @@ def test_stop_correct(self) -> None:
"option_ids": [1],
"meeting_id": 1,
"entitled_group_ids": [1],
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
"option/1": {"meeting_id": 1, "poll_id": 1},
"group/1": {"meeting_id": 1},
Expand Down Expand Up @@ -153,6 +159,9 @@ def test_stop_assignment_poll(self) -> None:
"backend": "fast",
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
}
)
Expand All @@ -175,6 +184,9 @@ def test_stop_entitled_users_at_stop_user_only_once(self) -> None:
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"entitled_group_ids": [3, 4],
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
"user/2": {
"is_present_in_meeting_ids": [1],
Expand Down Expand Up @@ -221,6 +233,9 @@ def test_stop_entitled_users_not_present(self) -> None:
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"entitled_group_ids": [3],
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
"user/2": {
"meeting_user_ids": [12],
Expand Down Expand Up @@ -269,6 +284,9 @@ def test_stop_entitled_users_with_delegations(self) -> None:
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"entitled_group_ids": [3],
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
"user/2": {
"meeting_user_ids": [12],
Expand Down Expand Up @@ -328,6 +346,9 @@ def test_stop_entitled_users_with_delegations_turned_off(self) -> None:
"state": Poll.STATE_STARTED,
"meeting_id": 1,
"entitled_group_ids": [3],
"onehundred_percent_base": "Y",
"sequential_number": 1,
"title": "Poll 1",
},
"user/2": {
"meeting_user_ids": [12],
Expand Down
56 changes: 56 additions & 0 deletions tests/system/action/poll/test_vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def test_vote_correct_pollmethod_Y(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"meeting/113": {
"users_enable_vote_weight": True,
Expand Down Expand Up @@ -160,6 +162,8 @@ def test_value_check(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -210,6 +214,8 @@ def test_vote_correct_pollmethod_YN(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -298,6 +304,8 @@ def test_vote_wrong_votes_total(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -343,6 +351,9 @@ def test_vote_pollmethod_Y_wrong_value(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -390,6 +401,8 @@ def test_vote_no_votes_total_check_by_YNA(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -437,6 +450,8 @@ def test_vote_no_votes_total_check_by_YN(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -484,6 +499,8 @@ def test_vote_wrong_votes_total_min_case(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -552,6 +569,8 @@ def test_vote_global(self) -> None:
"pollmethod": "YNA",
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
}
)
Expand Down Expand Up @@ -610,6 +629,8 @@ def test_vote_schema_problems(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -645,6 +666,9 @@ def test_vote_invalid_vote_value(self) -> None:
"meeting_id": 113,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -689,6 +713,9 @@ def test_vote_not_started_in_service(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "YNA",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -728,6 +755,8 @@ def test_vote_option_not_in_poll(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -792,6 +821,8 @@ def test_double_vote(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
}
)
Expand Down Expand Up @@ -851,6 +882,9 @@ def test_check_user_in_entitled_group(self) -> None:
"state": Poll.STATE_STARTED,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"title": "Poll 1",
"onehundred_percent_base": "YNA",
},
}
)
Expand Down Expand Up @@ -886,6 +920,8 @@ def test_check_user_present_in_meeting(self) -> None:
"backend": "fast",
"type": "named",
"pollmethod": "YNA",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
}
)
Expand All @@ -910,6 +946,8 @@ def test_check_str_validation(self) -> None:
"pollmethod": "Y",
"state": Poll.STATE_STARTED,
"backend": "fast",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
"user/1": {
"is_present_in_meeting_ids": [113],
Expand Down Expand Up @@ -956,6 +994,8 @@ def test_default_vote_weight(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
"meeting/113": {"users_enable_vote_weight": True},
}
Expand Down Expand Up @@ -1019,6 +1059,8 @@ def test_vote_weight_not_enabled(self) -> None:
"max_votes_per_option": 1,
"backend": "fast",
"type": "named",
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
"meeting/113": {
"users_enable_vote_weight": False,
Expand Down Expand Up @@ -1135,6 +1177,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "YNA",
},
)

Expand Down Expand Up @@ -1329,6 +1373,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down Expand Up @@ -1553,6 +1599,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 5,
"max_votes_per_option": 3,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down Expand Up @@ -1663,6 +1711,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down Expand Up @@ -1866,6 +1916,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down Expand Up @@ -2029,6 +2081,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down Expand Up @@ -2180,6 +2234,8 @@ def create_poll(self) -> None:
"min_votes_amount": 1,
"max_votes_amount": 10,
"max_votes_per_option": 1,
"sequential_number": 1,
"onehundred_percent_base": "Y",
},
)

Expand Down