For test_confirm_anonymous and test_confirm_named, Celery blocked the tests from being able to send email, so by using django-celery-email as a backend, instead of having emails sent via a standalone task, the test runner can now override Celery when running tests.
OIDC authorization prevented the SendView tests from being authenticated, so for the tests, the default ModelBackend is in use.
test_post_ratelimited_recipient had the sender email address as the recipient email address, which is why the rate limit validation approved it in the form.
test_post_ratelimited_sender failed because no validation was present for the sender email, as it was not part of the form field. by overriding get_form_kwargs to supply the request user, the form is now able to validate the sender's email.
Fixed the failing tests:
For
test_confirm_anonymousandtest_confirm_named, Celery blocked the tests from being able to send email, so by usingdjango-celery-emailas a backend, instead of having emails sent via a standalone task, the test runner can now override Celery when running tests.OIDC authorization prevented the
SendViewtests from being authenticated, so for the tests, the defaultModelBackendis in use.test_post_ratelimited_recipienthad the sender email address as the recipient email address, which is why the rate limit validation approved it in the form.test_post_ratelimited_senderfailed because no validation was present for the sender email, as it was not part of the form field. by overridingget_form_kwargsto supply the request user, the form is now able to validate the sender's email.