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:49:43 +0200
commit22b2fb0ba1d130c0ff0e1658ee9c2224a619a4a7 (patch)
treefd748cb4cbb6fb15a4c93c9c82427d59c4c020da /tests
parenta764a9ccff6e2a2cf048e658dd824bf302c74df7 (diff)
Fixed #22939 -- Delayed admin_static backend detection
Thanks generalov for the report.
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 6006a0e504..b2c554da0f 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
@@ -101,6 +103,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.