summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-10-15 14:18:52 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-10-15 14:18:52 +0000
commitbc3f59787fa5673623c8178cbd208e0c26ec53f5 (patch)
tree030003f09430cd876ba90173be548f7af39ad633 /tests
parente2b83db9ef5bc5be3d42b75f7a4e37631a5bf165 (diff)
[1.1.X] Fixed a regression for Python 2.6 introduced in r11624 on this branch.
Backport of r11625 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/context_processors/templates/context_processors/auth_attrs_user.html1
-rw-r--r--tests/regressiontests/context_processors/tests.py4
-rw-r--r--tests/regressiontests/context_processors/urls.py1
-rw-r--r--tests/regressiontests/context_processors/views.py3
4 files changed, 8 insertions, 1 deletions
diff --git a/tests/regressiontests/context_processors/templates/context_processors/auth_attrs_user.html b/tests/regressiontests/context_processors/templates/context_processors/auth_attrs_user.html
index 7ff2c938a2..7ed16d7867 100644
--- a/tests/regressiontests/context_processors/templates/context_processors/auth_attrs_user.html
+++ b/tests/regressiontests/context_processors/templates/context_processors/auth_attrs_user.html
@@ -1,3 +1,4 @@
unicode: {{ user }}
id: {{ user.id }}
username: {{ user.username }}
+url: {% url userpage user %}
diff --git a/tests/regressiontests/context_processors/tests.py b/tests/regressiontests/context_processors/tests.py
index a05b143e55..c7fc4e5a93 100644
--- a/tests/regressiontests/context_processors/tests.py
+++ b/tests/regressiontests/context_processors/tests.py
@@ -4,7 +4,7 @@ Tests for Django's bundled context processors.
from django.conf import settings
from django.test import TestCase
-
+from django.template import Template
class RequestContextProcessorTests(TestCase):
"""
@@ -79,3 +79,5 @@ class AuthContextProcessorTests(TestCase):
self.assertContains(response, "unicode: super")
self.assertContains(response, "id: 100")
self.assertContains(response, "username: super")
+ # bug #12037 is tested by the {% url %} in the template:
+ self.assertContains(response, "url: /userpage/super/")
diff --git a/tests/regressiontests/context_processors/urls.py b/tests/regressiontests/context_processors/urls.py
index 45c5fe7777..30728c8df8 100644
--- a/tests/regressiontests/context_processors/urls.py
+++ b/tests/regressiontests/context_processors/urls.py
@@ -10,4 +10,5 @@ urlpatterns = patterns('',
(r'^auth_processor_user/$', views.auth_processor_user),
(r'^auth_processor_perms/$', views.auth_processor_perms),
(r'^auth_processor_messages/$', views.auth_processor_messages),
+ url(r'^userpage/(.+)/$', views.userpage, name="userpage"),
)
diff --git a/tests/regressiontests/context_processors/views.py b/tests/regressiontests/context_processors/views.py
index e5195f9c65..3f2dcb037b 100644
--- a/tests/regressiontests/context_processors/views.py
+++ b/tests/regressiontests/context_processors/views.py
@@ -32,3 +32,6 @@ def auth_processor_messages(request):
request.user.message_set.create(message="Message 1")
return render_to_response('context_processors/auth_attrs_messages.html',
RequestContext(request, {}, processors=[context_processors.auth]))
+
+def userpage(request):
+ pass