summaryrefslogtreecommitdiff
path: root/tests/admin_views/tests.py
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2014-12-27 02:16:53 -0500
committerLoic Bistuer <loic.bistuer@gmail.com>2015-01-17 22:09:10 +0700
commita420f83e7d2e446ca01ef7c13d30c2ef3e975e5c (patch)
treec3c6aed2cd6c160d2f75e2f6f3f9d8c0b08d8ce7 /tests/admin_views/tests.py
parent67235fd4ef1b006fc9cdb2fa20e7bb93b0edff4b (diff)
Fixed #24055 -- Keep reference to view class for resolve()
Diffstat (limited to 'tests/admin_views/tests.py')
-rw-r--r--tests/admin_views/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 0c28ecc029..c41a348078 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -11,7 +11,7 @@ from django.core.checks import Error
from django.core.files import temp as tempfile
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import (NoReverseMatch,
- get_script_prefix, reverse, set_script_prefix)
+ get_script_prefix, resolve, reverse, set_script_prefix)
# Register auth models with the admin.
from django.contrib.auth import get_permission_codename
from django.contrib.admin import ModelAdmin
@@ -56,6 +56,7 @@ from .models import (Article, BarAccount, CustomArticle, EmptyModel, FooAccount,
Simple, UndeletableObject, UnchangeableObject, Choice, ShortMessage,
Telegram, Pizza, Topping, FilteredManager, City, Restaurant, Worker,
ParentWithDependentChildren, Character, FieldOverridePost, Color2)
+from . import customadmin
from .admin import site, site2, CityAdmin
@@ -749,6 +750,12 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
with self.assertRaises(NoReverseMatch):
reverse('admin:app_list', args=('admin_views2',))
+ def test_resolve_admin_views(self):
+ index_match = resolve('/test_admin/admin4/')
+ list_match = resolve('/test_admin/admin4/auth/user/')
+ self.assertIs(index_match.func.admin_site, customadmin.simple_site)
+ self.assertIsInstance(list_match.func.model_admin, customadmin.CustomPwdTemplateUserAdmin)
+
def test_proxy_model_content_type_is_used_for_log_entries(self):
"""
Log entries for proxy models should have the proxy model's content