summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-07-07 09:54:58 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-07-12 18:50:32 +0200
commitbe38c5bcc8b6d641d210cbcf0508605223366778 (patch)
tree29aa5e36cc4b9ce05139db5f96d1241662bb2f92 /tests
parentdda6759e0e7f4ff4e1a856c1d907cea619a1dfda (diff)
[1.7.x] Fixed #22939 -- Delayed admin_static backend detection
Thanks generalov for the report. Backport of 22b2fb0b from master
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_views/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 48ee0de60e..f5b6180e4c 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -18,6 +18,7 @@ from django.contrib.auth import get_permission_codename
from django.contrib.admin import ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import LogEntry, DELETION
+from django.contrib.admin.templatetags.admin_static import static
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.utils import quote
@@ -26,6 +27,7 @@ from django.contrib.admin.views.main import IS_POPUP_VAR
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.models import Group, User, Permission
from django.contrib.contenttypes.models import ContentType
+from django.contrib.staticfiles.storage import staticfiles_storage
from django.forms.utils import ErrorList
from django.template.response import TemplateResponse
from django.test import TestCase, skipUnlessDBFeature
@@ -102,6 +104,18 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
'/test_admin/%s/admin_views/article/add/' % self.urlbit,
status_code=301)
+ def test_admin_static_template_tag(self):
+ """
+ Test that admin_static.static is pointing to the collectstatic version
+ (as django.contrib.collectstatic is in installed apps).
+ """
+ old_url = staticfiles_storage.base_url
+ staticfiles_storage.base_url = '/test/'
+ try:
+ self.assertEqual(static('path'), '/test/path')
+ finally:
+ staticfiles_storage.base_url = old_url
+
def test_basic_add_GET(self):
"""
A smoke test to ensure GET on the add_view works.