summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-12-27 20:41:54 -0500
committerTim Graham <timograham@gmail.com>2019-01-17 10:52:19 -0500
commit92d4d0859a63347de6e2a7bc3ddd49979cc192c5 (patch)
treee8257beec76b3e488beca0b1e3f783fc1234aa45 /tests/staticfiles_tests
parent958a7b4ca69434d0145fd569cf007e21841bb36c (diff)
downloaddjango-92d4d0859a63347de6e2a7bc3ddd49979cc192c5.tar.gz
Refs #21221 -- Removed staticfiles and admin_static template tag libraries.
Per deprecation timeline.
Diffstat (limited to 'tests/staticfiles_tests')
-rw-r--r--tests/staticfiles_tests/test_templatetag_deprecation.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/staticfiles_tests/test_templatetag_deprecation.py b/tests/staticfiles_tests/test_templatetag_deprecation.py
deleted file mode 100644
index 898ee68093..0000000000
--- a/tests/staticfiles_tests/test_templatetag_deprecation.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from urllib.parse import urljoin
-
-from django.contrib.staticfiles import storage
-from django.contrib.staticfiles.templatetags.staticfiles import static
-from django.template import Context, Template
-from django.test import SimpleTestCase, override_settings
-from django.utils.deprecation import RemovedInDjango30Warning
-
-
-class StaticTestStorage(storage.StaticFilesStorage):
- def url(self, name):
- return urljoin('https://example.com/assets/', name)
-
-
-@override_settings(
- STATIC_URL='http://media.example.com/static/',
- INSTALLED_APPS=('django.contrib.staticfiles',),
- STATICFILES_STORAGE='staticfiles_tests.test_forms.StaticTestStorage',
-)
-class StaticDeprecationTests(SimpleTestCase):
- def test_templatetag_deprecated(self):
- msg = '{% load staticfiles %} is deprecated in favor of {% load static %}.'
- template = "{% load staticfiles %}{% static 'main.js' %}"
- with self.assertWarnsMessage(RemovedInDjango30Warning, msg):
- template = Template(template)
- rendered = template.render(Context())
- self.assertEqual(rendered, 'https://example.com/assets/main.js')
-
- def test_static_deprecated(self):
- msg = (
- 'django.contrib.staticfiles.templatetags.static() is deprecated in '
- 'favor of django.templatetags.static.static().'
- )
- with self.assertWarnsMessage(RemovedInDjango30Warning, msg):
- url = static('main.js')
- self.assertEqual(url, 'https://example.com/assets/main.js')