Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed forced settings in runtests

Tests that require USE_I18N, LOGIN_URL or certain MIDDLEWARE_CLASSES
should be decorated appropriately.
  • Loading branch information...
commit 9b74a8391de81312a6d2f97ce40f3ed856285d9f 1 parent 3f1efc4
Claude Paroz authored March 11, 2013
2  tests/forms_tests/templates/forms_tests/article_form.html
... ...
@@ -1,6 +1,6 @@
1 1
 <html>
2 2
 <body>
3  
-  <form method="post" action=".">
  3
+  <form method="post" action=".">{% csrf_token %}
4 4
     {{ form.as_p }}<br>
5 5
     <input id="submit" type="submit">
6 6
   </form>
15  tests/runtests.py
@@ -62,14 +62,12 @@ def get_test_modules():
62 62
 
63 63
 def setup(verbosity, test_labels):
64 64
     from django.conf import settings
  65
+    from django.db.models.loading import get_apps, load_app
65 66
     state = {
66 67
         'INSTALLED_APPS': settings.INSTALLED_APPS,
67 68
         'ROOT_URLCONF': getattr(settings, "ROOT_URLCONF", ""),
68 69
         'TEMPLATE_DIRS': settings.TEMPLATE_DIRS,
69  
-        'USE_I18N': settings.USE_I18N,
70  
-        'LOGIN_URL': settings.LOGIN_URL,
71 70
         'LANGUAGE_CODE': settings.LANGUAGE_CODE,
72  
-        'MIDDLEWARE_CLASSES': settings.MIDDLEWARE_CLASSES,
73 71
         'STATIC_URL': settings.STATIC_URL,
74 72
         'STATIC_ROOT': settings.STATIC_ROOT,
75 73
     }
@@ -80,15 +78,7 @@ def setup(verbosity, test_labels):
80 78
     settings.STATIC_URL = '/static/'
81 79
     settings.STATIC_ROOT = os.path.join(TEMP_DIR, 'static')
82 80
     settings.TEMPLATE_DIRS = (os.path.join(RUNTESTS_DIR, TEST_TEMPLATE_DIR),)
83  
-    settings.USE_I18N = True
84 81
     settings.LANGUAGE_CODE = 'en'
85  
-    settings.LOGIN_URL = 'django.contrib.auth.views.login'
86  
-    settings.MIDDLEWARE_CLASSES = (
87  
-        'django.contrib.sessions.middleware.SessionMiddleware',
88  
-        'django.contrib.auth.middleware.AuthenticationMiddleware',
89  
-        'django.contrib.messages.middleware.MessageMiddleware',
90  
-        'django.middleware.common.CommonMiddleware',
91  
-    )
92 82
     settings.SITE_ID = 1
93 83
     # For testing comment-utils, we require the MANAGERS attribute
94 84
     # to be set, so that a test email is sent out which we catch
@@ -96,9 +86,6 @@ def setup(verbosity, test_labels):
96 86
     settings.MANAGERS = ("admin@djangoproject.com",)
97 87
 
98 88
     # Load all the ALWAYS_INSTALLED_APPS.
99  
-    # (This import statement is intentionally delayed until after we
100  
-    # access settings because of the USE_I18N dependency.)
101  
-    from django.db.models.loading import get_apps, load_app
102 89
     get_apps()
103 90
 
104 91
     # Load all the test model apps.

0 notes on commit 9b74a83

Please sign in to comment.
Something went wrong with that request. Please try again.