mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Refs #25484 -- Made non-staticfiles {% static %} tag quote its output.
This commit is contained in:
parent
e233f357bd
commit
1a04b1762b
2 changed files with 5 additions and 11 deletions
|
@ -51,13 +51,7 @@ class StaticTagTests(SimpleTestCase):
|
|||
output = self.engine.render_to_string('static-statictag04', {'base_css': 'admin/base.css'})
|
||||
self.assertEqual(output, urljoin(settings.STATIC_URL, 'admin/base.css'))
|
||||
|
||||
@setup({'static-statictag05': '{% load static %}{% static "test.html?foo=1&bar=2" %}'})
|
||||
def test_static_escapes_urls(self):
|
||||
@setup({'static-statictag05': '{% load static %}{% static "special?chars"ed.html" %}'})
|
||||
def test_static_quotes_urls(self):
|
||||
output = self.engine.render_to_string('static-statictag05')
|
||||
self.assertEqual(output, urljoin(settings.STATIC_URL, '/static/test.html?foo=1&bar=2'))
|
||||
|
||||
@setup({'static-statictag06': '{% load static %}'
|
||||
'{% autoescape off %}{% static "test.html?foo=1&bar=2" %}{% endautoescape %}'})
|
||||
def test_static_escapes_urls_autoescape_off(self):
|
||||
output = self.engine.render_to_string('static-statictag06')
|
||||
self.assertEqual(output, urljoin(settings.STATIC_URL, '/static/test.html?foo=1&bar=2'))
|
||||
self.assertEqual(output, urljoin(settings.STATIC_URL, '/static/special%3Fchars%26quoted.html'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue