diff options
author | Tobias McNulty <tobias@caktusgroup.com> | 2016-06-03 15:02:38 -0700 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-06-20 11:07:46 -0400 |
commit | 17e661641ddaf8266e7430d83cfb2039abc55df7 (patch) | |
tree | faab4310a86fed5682ff343efcffc9a9816a2eb3 /django/test/utils.py | |
parent | 00551c3eff5cedcb9cc7ce5af97b948d62713d97 (diff) | |
download | django-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.py | 3 |
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 = [] |