summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_querystring.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests/test_querystring.py')
-rw-r--r--tests/template_tests/syntax_tests/test_querystring.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_querystring.py b/tests/template_tests/syntax_tests/test_querystring.py
index 3f1cf3d281..099be96f9e 100644
--- a/tests/template_tests/syntax_tests/test_querystring.py
+++ b/tests/template_tests/syntax_tests/test_querystring.py
@@ -17,6 +17,15 @@ class QueryStringTagTests(SimpleTestCase):
output = template.render(context)
self.assertEqual(output, "")
+ @setup({"test_querystring_remove_all_params": "{% querystring a=None %}"})
+ def test_querystring_remove_all_params(self):
+ non_empty_context = RequestContext(self.request_factory.get("/?a=b"))
+ empty_context = RequestContext(self.request_factory.get("/"))
+ template = self.engine.get_template("test_querystring_remove_all_params")
+ for context, expected in [(non_empty_context, "?"), (empty_context, "")]:
+ with self.subTest(expected=expected):
+ self.assertEqual(template.render(context), expected)
+
@setup({"querystring_non_empty": "{% querystring %}"})
def test_querystring_non_empty(self):
request = self.request_factory.get("/", {"a": "b"})