-
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.
fix: refactor assignment braze tasks, and so forth
- Loading branch information
1 parent
51c1b17
commit 87f6fe6
Showing
7 changed files
with
309 additions
and
189 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
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 |
---|---|---|
|
@@ -64,7 +64,6 @@ def setUp(self): | |
state=LearnerContentAssignmentStateChoices.ALLOCATED, | ||
) | ||
|
||
@mock.patch(COMMAND_PATH + '.LmsApiClient', return_value=mock.MagicMock()) | ||
@mock.patch(COMMAND_PATH + '.get_content_metadata_for_assignments') | ||
@mock.patch(COMMAND_PATH + '.send_assignment_automatically_expired_email.delay') | ||
@mock.patch('enterprise_access.apps.subsidy_access_policy.models.SubsidyAccessPolicy.subsidy_client') | ||
|
@@ -73,7 +72,6 @@ def test_command_dry_run( | |
mock_subsidy_client, | ||
mock_send_assignment_automatically_expired_email_task, | ||
mock_content_metadata_for_assignments, | ||
mock_lms_api_client | ||
): | ||
""" | ||
Verify that management command work as expected in dry run mode. | ||
|
@@ -101,9 +99,6 @@ def test_command_dry_run( | |
}, | ||
}, | ||
} | ||
mock_lms_api_client().get_enterprise_customer_data.return_value = { | ||
'admin_users': [{'email': '[email protected]'}, {'email': '[email protected]'}], | ||
} | ||
mock_path = COMMAND_PATH + '.logger.info' | ||
|
||
all_assignment = LearnerContentAssignment.objects.all() | ||
|
@@ -168,7 +163,6 @@ def test_command_dry_run( | |
# verify that state has not changed for any assignment | ||
assert all_assignment.count() == allocated_assignments.count() | ||
|
||
@mock.patch(COMMAND_PATH + '.LmsApiClient', return_value=mock.MagicMock()) | ||
@mock.patch(COMMAND_PATH + '.get_content_metadata_for_assignments') | ||
@mock.patch(COMMAND_PATH + '.send_assignment_automatically_expired_email.delay') | ||
@mock.patch('enterprise_access.apps.subsidy_access_policy.models.SubsidyAccessPolicy.subsidy_client') | ||
|
@@ -177,7 +171,6 @@ def test_command( | |
mock_subsidy_client, | ||
mock_send_assignment_automatically_expired_email_task, | ||
mock_content_metadata_for_assignments, | ||
mock_lms_api_client | ||
): | ||
""" | ||
Verify that management command work as expected in dry run mode. | ||
|
@@ -200,9 +193,6 @@ def test_command( | |
}, | ||
}, | ||
} | ||
mock_lms_api_client().get_enterprise_customer_data.return_value = { | ||
'admin_users': [{'email': '[email protected]'}, {'email': '[email protected]'}], | ||
} | ||
mock_path = COMMAND_PATH + '.logger.info' | ||
|
||
all_assignment = LearnerContentAssignment.objects.all() | ||
|
@@ -260,8 +250,8 @@ def test_command( | |
) | ||
mock_send_assignment_automatically_expired_email_task.assert_has_calls( | ||
[ | ||
call(self.alice_assignment.uuid, ['[email protected]', '[email protected]']), | ||
call(self.bob_assignment.uuid, ['[email protected]', '[email protected]']) | ||
call(self.alice_assignment.uuid), | ||
call(self.bob_assignment.uuid) | ||
] | ||
) | ||
|
||
|
Oops, something went wrong.