Skip to content

Commit

Permalink
test: updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed May 13, 2024
1 parent 233b3fb commit e6d279b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_enterprise/api/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8084,12 +8084,17 @@ def test_successful_remove_learners_from_group(self, mock_send_group_membership_
membership = EnterpriseGroupMembershipFactory(group=self.group_2)
memberships_to_delete.append(membership)
existing_emails.append(membership.enterprise_customer_user.user.email)

request_data = {'learner_emails': existing_emails}
catalog_uuid = uuid.uuid4()
request_data = {'learner_emails': existing_emails, 'catalog_uuid': catalog_uuid}
response = self.client.post(url, data=request_data)
assert response.status_code == 200
assert response.data == {'records_deleted': 10}
assert mock_send_group_membership_removal_notification.call_count == 1
mock_send_group_membership_removal_notification.assert_called_once_with(
self.enterprise_customer.uuid,
[membership.uuid for membership in reversed(memberships_to_delete)],
catalog_uuid,
)
for membership in memberships_to_delete:
assert EnterpriseGroupMembership.all_objects.get(pk=membership.pk).status == 'removed'
assert EnterpriseGroupMembership.all_objects.get(pk=membership.pk).removed_at
Expand Down

0 comments on commit e6d279b

Please sign in to comment.