1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #17515 -- Added ability to override the template of custom admin FilterSpec classes. Thanks, saxix and Julien Phalip.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17483 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2012-02-09 18:59:05 +00:00
parent 875a5ea8d4
commit 4dbeb4bca4
7 changed files with 55 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
# coding: utf-8
from __future__ import with_statement, absolute_import
import os
import re
import datetime
import urlparse
@@ -593,6 +594,18 @@ class AdminViewFormUrlTest(TestCase):
self.assertTrue('form_url' in response.context, msg='form_url not present in response.context')
self.assertEqual(response.context['form_url'], 'pony')
def test_filter_with_custom_template(self):
"""
Ensure that one can use a custom template to render an admin filter.
Refs #17515.
"""
template_dirs = settings.TEMPLATE_DIRS + (
os.path.join(os.path.dirname(__file__), 'templates'),)
with self.settings(TEMPLATE_DIRS=template_dirs):
response = self.client.get("/test_admin/admin/admin_views/color2/")
self.assertTrue('custom_filter_template.html' in [t.name for t in response.templates])
class AdminJavaScriptTest(AdminViewBasicTest):
urls = "regressiontests.admin_views.urls"