mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #25484 -- Made {% static %} render escaped URLs.
This commit is contained in:
parent
33e86b3488
commit
374e6230ca
4 changed files with 19 additions and 3 deletions
|
@ -50,3 +50,14 @@ class StaticTagTests(SimpleTestCase):
|
|||
def test_static_statictag04(self):
|
||||
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):
|
||||
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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue