예제 #1
0
 def test_backend_honors_explicit_use_tls_false(self):
     use_tls = False
     explicit_use_tls = True
     self.configuration.use_tls = use_tls
     self.configuration.save()
     backend = ConfiguredEmailBackend(use_tls=explicit_use_tls)
     self.assertEqual(backend.use_tls, explicit_use_tls)
예제 #2
0
 def test_backend_honors_explicit_use_ssl_true(self):
     use_ssl = True
     explicit_use_ssl = False
     self.configuration.use_ssl = use_ssl
     self.configuration.save()
     backend = ConfiguredEmailBackend(use_ssl=explicit_use_ssl)
     self.assertEqual(backend.use_ssl, explicit_use_ssl)
예제 #3
0
 def test_backend_honors_explicit_fail_silently_true(self):
     fail_silently = True
     explicit_fail_silently = False
     self.configuration.fail_silently = fail_silently
     self.configuration.save()
     backend = ConfiguredEmailBackend(fail_silently=explicit_fail_silently)
     self.assertEqual(backend.fail_silently, explicit_fail_silently)
예제 #4
0
 def test_backend_honors_explicit_password(self):
     password = '******'
     explicit_password = '******'
     self.configuration.password = password
     self.configuration.save()
     backend = ConfiguredEmailBackend(password=explicit_password)
     self.assertEqual(backend.password, explicit_password)
예제 #5
0
 def test_backend_honors_explicit_username(self):
     username = '******'
     explicit_username = '******'
     self.configuration.username = username
     self.configuration.save()
     backend = ConfiguredEmailBackend(username=explicit_username)
     self.assertEqual(backend.username, explicit_username)
예제 #6
0
 def test_backend_honors_explicit_port(self):
     port = 123
     explicit_port = 321
     self.configuration.port = port
     self.configuration.save()
     backend = ConfiguredEmailBackend(port=explicit_port)
     self.assertEqual(backend.port, explicit_port)
예제 #7
0
 def test_backend_honors_explicit_host(self):
     host = 'testhost.mysite.com'
     explicit_host = 'anotherhost.mysite.com'
     self.configuration.host = host
     self.configuration.save()
     backend = ConfiguredEmailBackend(host=explicit_host)
     self.assertEqual(backend.host, explicit_host)
예제 #8
0
 def test_backend_does_not_permit_mutex_tls_and_ssl(self):
     try:
         ConfiguredEmailBackend(use_tls=True, use_ssl=True)
         self.fail("No exception thrown. Expected ValueError")
     except ValueError:
         pass  # Test succeeded
     except Exception:
         self.fail("Incorrect exception thrown: {}".format(
             traceback.format_exc()))
예제 #9
0
 def test_backend_honors_configured_timeout(self):
     timeout = 12345
     self.configuration.timeout = timeout
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.timeout, timeout)
예제 #10
0
 def test_backend_honors_configured_fail_silently_false(self):
     fail_silently = False
     self.configuration.fail_silently = fail_silently
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.fail_silently, fail_silently)
예제 #11
0
 def test_backend_honors_configured_use_ssl_false(self):
     use_ssl = False
     self.configuration.use_ssl = use_ssl
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.use_ssl, use_ssl)
예제 #12
0
 def test_backend_honors_configured_use_tls_true(self):
     use_tls = True
     self.configuration.use_tls = use_tls
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.use_tls, use_tls)
예제 #13
0
 def test_backend_honors_configured_password(self):
     password = '******'
     self.configuration.password = password
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.password, password)
예제 #14
0
 def test_backend_honors_configured_username(self):
     username = '******'
     self.configuration.username = username
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.username, username)
예제 #15
0
 def test_backend_honors_configured_port(self):
     port = 123
     self.configuration.port = port
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.port, port)
예제 #16
0
 def test_backend_honors_configured_host(self):
     host = 'testhost.mysite.com'
     self.configuration.host = host
     self.configuration.save()
     backend = ConfiguredEmailBackend()
     self.assertEqual(backend.host, host)