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:
medmunds
2017-01-19 19:22:16 -08:00
parent 0ba5d1d4ad
commit bff01b440a
2 changed files with 7 additions and 4 deletions

View File

@@ -96,10 +96,12 @@ class MandrillWebhookSecurityTestCase(WebhookTestCase, WebhookBasicAuthTestsMixi
response = self.client.post(**kwargs)
self.assertEqual(response.status_code, 200)
@override_settings(ANYMAIL={
"MANDRILL_WEBHOOK_URL": "https://abcde:12345@example.com/anymail/mandrill/tracking/",
"WEBHOOK_AUTHORIZATION": "abcde:12345",
})
@override_settings(
ALLOWED_HOSTS=['127.0.0.1', '.example.com'],
ANYMAIL={
"MANDRILL_WEBHOOK_URL": "https://abcde:12345@example.com/anymail/mandrill/tracking/",
"WEBHOOK_AUTHORIZATION": "abcde:12345",
})
def test_webhook_url_setting(self):
# If Django can't build_absolute_uri correctly (e.g., because your proxy
# frontend isn't setting the proxy headers correctly), you must set