mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Fix webhook tests for Django 1.11-alpha
Django 1.11 appears to enforce ALLOWED_HOSTS (more strictly) during tests.
This commit is contained in:
@@ -96,10 +96,12 @@ class MandrillWebhookSecurityTestCase(WebhookTestCase, WebhookBasicAuthTestsMixi
|
|||||||
response = self.client.post(**kwargs)
|
response = self.client.post(**kwargs)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
@override_settings(ANYMAIL={
|
@override_settings(
|
||||||
"MANDRILL_WEBHOOK_URL": "https://abcde:12345@example.com/anymail/mandrill/tracking/",
|
ALLOWED_HOSTS=['127.0.0.1', '.example.com'],
|
||||||
"WEBHOOK_AUTHORIZATION": "abcde:12345",
|
ANYMAIL={
|
||||||
})
|
"MANDRILL_WEBHOOK_URL": "https://abcde:12345@example.com/anymail/mandrill/tracking/",
|
||||||
|
"WEBHOOK_AUTHORIZATION": "abcde:12345",
|
||||||
|
})
|
||||||
def test_webhook_url_setting(self):
|
def test_webhook_url_setting(self):
|
||||||
# If Django can't build_absolute_uri correctly (e.g., because your proxy
|
# If Django can't build_absolute_uri correctly (e.g., because your proxy
|
||||||
# frontend isn't setting the proxy headers correctly), you must set
|
# frontend isn't setting the proxy headers correctly), you must set
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ class UpdateDeepTests(SimpleTestCase):
|
|||||||
self.assertEqual(first, {'a': {'a1': 1, 'a2': 2}, 'c': {'c1': 1}})
|
self.assertEqual(first, {'a': {'a1': 1, 'a2': 2}, 'c': {'c1': 1}})
|
||||||
|
|
||||||
|
|
||||||
|
@override_settings(ALLOWED_HOSTS=[".example.com"])
|
||||||
class RequestUtilsTests(SimpleTestCase):
|
class RequestUtilsTests(SimpleTestCase):
|
||||||
"""Test utils.get_request_* helpers"""
|
"""Test utils.get_request_* helpers"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user