From 1a04b1762b50ea4d09eb1dc192d57172750b80aa Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 19 Dec 2016 13:44:02 -0500 Subject: Refs #25484 -- Made non-staticfiles {% static %} tag quote its output. --- tests/template_tests/syntax_tests/test_static.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/template_tests/syntax_tests/test_static.py') diff --git a/tests/template_tests/syntax_tests/test_static.py b/tests/template_tests/syntax_tests/test_static.py index d5ca9ecf60..deb0ce6c78 100644 --- a/tests/template_tests/syntax_tests/test_static.py +++ b/tests/template_tests/syntax_tests/test_static.py @@ -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')) -- cgit v1.3