-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allowing for group members to be specified when fetched
- Loading branch information
1 parent
661ece1
commit d2dedf7
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2301,6 +2301,36 @@ def test_get_group_member_data_with_aggregates_success( | |
assert response.headers.get('Content-Type') == 'application/json' | ||
assert response.data == expected_response | ||
|
||
@mock.patch('enterprise_access.apps.api.v1.views.subsidy_access_policy.LmsApiClient') | ||
@mock.patch( | ||
'enterprise_access.apps.api.v1.views.subsidy_access_policy.get_and_cache_subsidy_learners_aggregate_data' | ||
) | ||
def test_get_group_member_data_with_aggregates_supports_specified_learners( | ||
self, | ||
mock_subsidy_learners_aggregate_data_cache, | ||
mock_lms_api_client, | ||
): | ||
""" | ||
Test that the `get_group_member_data_with_aggregates` endpoint supports specifying individual learners | ||
""" | ||
mock_subsidy_learners_aggregate_data_cache.return_value = {1: 99} | ||
mock_lms_api_client.return_value.fetch_group_members.return_value = self.mock_fetch_group_members | ||
uuid = uuid4() | ||
self.client.get( | ||
self.subsidy_access_policy_can_redeem_endpoint, | ||
{'group_uuid': uuid, 'learners': ["[email protected]"], 'page': 1} | ||
) | ||
mock_lms_api_client.return_value.fetch_group_members.assert_called_with( | ||
group_uuid=uuid, | ||
sort_by=None, | ||
user_query=None, | ||
show_removed=False, | ||
is_reversed=False, | ||
traverse_pagination=False, | ||
page=1, | ||
learners=["[email protected]"], | ||
) | ||
|
||
@mock.patch('enterprise_access.apps.api.v1.views.subsidy_access_policy.LmsApiClient') | ||
@mock.patch( | ||
'enterprise_access.apps.api.v1.views.subsidy_access_policy.get_and_cache_subsidy_learners_aggregate_data' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters