-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 [#4650] Revert generic test changes
The test module is aimed at the generic registration mechanism and just 'happens' to use the email plugin. We do not need to repeat all the various cases/failure modes that are already covered by the plugin unit tests.
- Loading branch information
1 parent
b234978
commit 2f06255
Showing
1 changed file
with
1 addition
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,7 +312,7 @@ def test_registration_backend_invalid_options(self): | |
completed=True, | ||
form__registration_backend="email", | ||
form__registration_backend_options={}, | ||
) # Missing "to_emails" and "to_emails_from_variable" option | ||
) # Missing "to_emails" option | ||
|
||
with ( | ||
self.subTest("On completion - does NOT raise"), | ||
|
@@ -334,48 +334,6 @@ def test_registration_backend_invalid_options(self): | |
): | ||
register_submission(submission.id, PostSubmissionEvents.on_retry) | ||
|
||
def test_email_registration_backend_with_to_emails(self): | ||
submission = SubmissionFactory.create( | ||
completed=True, | ||
form__registration_backend="email", | ||
form__registration_backend_options={"to_emails": ["[email protected]"]}, | ||
) | ||
|
||
with ( | ||
self.subTest("On completion - logs as successful"), | ||
self.assertLogs(level="INFO") as logs, | ||
): | ||
register_submission(submission.id, PostSubmissionEvents.on_completion) | ||
|
||
submission.refresh_from_db() | ||
self.assertIn( | ||
"Registration using plugin '%r' for submission '%s' succeeded", | ||
logs.records[-1].msg, | ||
) | ||
self.assertFalse(submission.needs_on_completion_retry) | ||
|
||
def test_email_registration_backend_with_to_emails_from_variable(self): | ||
submission = SubmissionFactory.create( | ||
completed=True, | ||
form__registration_backend="email", | ||
form__registration_backend_options={ | ||
"to_emails_from_variable": "email_example_variable" | ||
}, | ||
) | ||
|
||
with ( | ||
self.subTest("On completion - logs as successful"), | ||
self.assertLogs(level="INFO") as logs, | ||
): | ||
register_submission(submission.id, PostSubmissionEvents.on_completion) | ||
|
||
submission.refresh_from_db() | ||
self.assertIn( | ||
"Registration using plugin '%r' for submission '%s' succeeded", | ||
logs.records[-1].msg, | ||
) | ||
self.assertFalse(submission.needs_on_completion_retry) | ||
|
||
def test_calling_registration_task_with_serialized_args(self): | ||
submission = SubmissionFactory.create( | ||
completed=True, | ||
|