summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorTobias McNulty <tobias@caktusgroup.com>2016-06-03 15:02:38 -0700
committerTim Graham <timograham@gmail.com>2016-06-20 11:07:46 -0400
commit17e661641ddaf8266e7430d83cfb2039abc55df7 (patch)
treefaab4310a86fed5682ff343efcffc9a9816a2eb3 /django/test/utils.py
parent00551c3eff5cedcb9cc7ce5af97b948d62713d97 (diff)
downloaddjango-17e661641ddaf8266e7430d83cfb2039abc55df7.tar.gz
Refs #26666 -- Added ALLOWED_HOSTS validation when running tests.
Also used ALLOWED_HOSTS to check for external hosts in assertRedirects().
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index e0b2b0da6c..ce235a5cea 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -111,7 +111,8 @@ def setup_test_environment():
settings.EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
request._original_allowed_hosts = settings.ALLOWED_HOSTS
- settings.ALLOWED_HOSTS = ['*']
+ # Add the default host of the test client.
+ settings.ALLOWED_HOSTS = settings.ALLOWED_HOSTS + ['testserver']
mail.outbox = []