Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_default_base_uri_retrieval():
backend = SparkPostEmailBackend()
assert backend.client.base_uri.startswith('https://' + US_API)
def test_eu_base_uri_retrieval():
reconfigure_settings(SPARKPOST_BASE_URI=EU_API)
backend = SparkPostEmailBackend()
assert backend.client.base_uri.startswith('https://' + EU_API)
def test_password_retrieval():
backend = SparkPostEmailBackend()
assert backend.client.api_key == API_KEY
def __init__(self, fail_silently=False, **kwargs):
super(SparkPostEmailBackend, self)\
.__init__(fail_silently=fail_silently, **kwargs)
sp_api_key = getattr(settings, 'SPARKPOST_API_KEY', None)
sp_base_uri = getattr(settings, 'SPARKPOST_BASE_URI', US_API)
self.client = SparkPost(sp_api_key, sp_base_uri)