summaryrefslogtreecommitdiff
path: root/tests/admin_views/tests.py
diff options
context:
space:
mode:
authorAdam Wentz <floppya@gmail.com>2013-03-23 20:11:55 -0600
committerSimon Charette <charette.s@gmail.com>2013-03-25 23:45:27 -0400
commita4b8a4b632dbb6d9fed1a8654aed99a9c53560d4 (patch)
tree33e3ac8c71f13820d9a64788073df2c8b88bcfd7 /tests/admin_views/tests.py
parentccf8d8111339fffc63d0334e83d9db8c99e9172e (diff)
Fixed #20121 -- Removed LogEntry.get_admin_url's hard-coded path.
Updated LogEntry.get_admin_url to use 'reverse' instead of a hard-coded path.
Diffstat (limited to 'tests/admin_views/tests.py')
-rw-r--r--tests/admin_views/tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 203d7d624b..a38ce93219 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -25,6 +25,7 @@ from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import Group, User, Permission, UNUSABLE_PASSWORD
from django.contrib.contenttypes.models import ContentType
+from django.core.urlresolvers import reverse
from django.forms.util import ErrorList
from django.template.response import TemplateResponse
from django.test import TestCase
@@ -1484,13 +1485,15 @@ class AdminViewStringPrimaryKeyTest(TestCase):
def test_recentactions_link(self):
"The link from the recent actions list referring to the changeform of the object should be quoted"
response = self.client.get('/test_admin/admin/')
- should_contain = """<a href="admin_views/modelwithstringprimarykey/%s/">%s</a>""" % (escape(quote(self.pk)), escape(self.pk))
+ link = reverse('admin:admin_views_modelwithstringprimarykey_change', args=(quote(self.pk),))
+ should_contain = """<a href="%s">%s</a>""" % (link, escape(self.pk))
self.assertContains(response, should_contain)
def test_recentactions_without_content_type(self):
"If a LogEntry is missing content_type it will not display it in span tag under the hyperlink."
response = self.client.get('/test_admin/admin/')
- should_contain = """<a href="admin_views/modelwithstringprimarykey/%s/">%s</a>""" % (escape(quote(self.pk)), escape(self.pk))
+ link = reverse('admin:admin_views_modelwithstringprimarykey_change', args=(quote(self.pk),))
+ should_contain = """<a href="%s">%s</a>""" % (link, escape(self.pk))
self.assertContains(response, should_contain)
should_contain = "Model with string primary key" # capitalized in Recent Actions
self.assertContains(response, should_contain)