| 638 | |
| 639 | @override_settings(EMAIL_HOST_USER="not empty username", |
| 640 | EMAIL_HOST_PASSWORD="not empty password") |
| 641 | def test_email_authentication_use_settings(self): |
| 642 | backend = smtp.EmailBackend() |
| 643 | self.assertEqual(backend.username, 'not empty username') |
| 644 | self.assertEqual(backend.password, 'not empty password') |
| 645 | |
| 646 | @override_settings(EMAIL_HOST_USER="not empty username", |
| 647 | EMAIL_HOST_PASSWORD="not empty password") |
| 648 | def test_email_authentication_override_settings(self): |
| 649 | backend = smtp.EmailBackend(username='username', password='password') |
| 650 | self.assertEqual(backend.username, 'username') |
| 651 | self.assertEqual(backend.password, 'password') |
| 652 | |
| 653 | @override_settings(EMAIL_HOST_USER="not empty username", |
| 654 | EMAIL_HOST_PASSWORD="not empty password") |
| 655 | def test_email_disabled_authentication(self): |
| 656 | backend = smtp.EmailBackend(username='', password='') |
| 657 | self.assertEqual(backend.username, '') |
| 658 | self.assertEqual(backend.password, '') |