summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-03-11 16:59:59 +0100
committerClaude Paroz <claude@2xlibre.net>2013-03-11 17:46:56 +0100
commit9b74a8391de81312a6d2f97ce40f3ed856285d9f (patch)
tree3f33b23f15cecac5a2d10414f8c11b64d38374ea
parent3f1efc44f65604a3e6bc09aba3dbfb649d3e966e (diff)
Removed forced settings in runtests
Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES should be decorated appropriately.
-rw-r--r--tests/forms_tests/templates/forms_tests/article_form.html2
-rwxr-xr-xtests/runtests.py15
2 files changed, 2 insertions, 15 deletions
diff --git a/tests/forms_tests/templates/forms_tests/article_form.html b/tests/forms_tests/templates/forms_tests/article_form.html
index cde85051f6..de38466335 100644
--- a/tests/forms_tests/templates/forms_tests/article_form.html
+++ b/tests/forms_tests/templates/forms_tests/article_form.html
@@ -1,6 +1,6 @@
<html>
<body>
- <form method="post" action=".">
+ <form method="post" action=".">{% csrf_token %}
{{ form.as_p }}<br>
<input id="submit" type="submit">
</form>
diff --git a/tests/runtests.py b/tests/runtests.py
index b0d942f1bb..f2cd933776 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -62,14 +62,12 @@ def get_test_modules():
def setup(verbosity, test_labels):
from django.conf import settings
+ from django.db.models.loading import get_apps, load_app
state = {
'INSTALLED_APPS': settings.INSTALLED_APPS,
'ROOT_URLCONF': getattr(settings, "ROOT_URLCONF", ""),
'TEMPLATE_DIRS': settings.TEMPLATE_DIRS,
- 'USE_I18N': settings.USE_I18N,
- 'LOGIN_URL': settings.LOGIN_URL,
'LANGUAGE_CODE': settings.LANGUAGE_CODE,
- 'MIDDLEWARE_CLASSES': settings.MIDDLEWARE_CLASSES,
'STATIC_URL': settings.STATIC_URL,
'STATIC_ROOT': settings.STATIC_ROOT,
}
@@ -80,15 +78,7 @@ def setup(verbosity, test_labels):
settings.STATIC_URL = '/static/'
settings.STATIC_ROOT = os.path.join(TEMP_DIR, 'static')
settings.TEMPLATE_DIRS = (os.path.join(RUNTESTS_DIR, TEST_TEMPLATE_DIR),)
- settings.USE_I18N = True
settings.LANGUAGE_CODE = 'en'
- settings.LOGIN_URL = 'django.contrib.auth.views.login'
- settings.MIDDLEWARE_CLASSES = (
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.common.CommonMiddleware',
- )
settings.SITE_ID = 1
# For testing comment-utils, we require the MANAGERS attribute
# to be set, so that a test email is sent out which we catch
@@ -96,9 +86,6 @@ def setup(verbosity, test_labels):
settings.MANAGERS = ("admin@djangoproject.com",)
# Load all the ALWAYS_INSTALLED_APPS.
- # (This import statement is intentionally delayed until after we
- # access settings because of the USE_I18N dependency.)
- from django.db.models.loading import get_apps, load_app
get_apps()
# Load all the test model apps.