summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_parser.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-09-19 09:27:19 -0400
committerTim Graham <timograham@gmail.com>2013-09-19 09:27:19 -0400
commit7fec5a2240835af7c7f3accd64d9d894d4f92782 (patch)
treee75a341cee3a1c5da2d412eda1870c682b47ce25 /tests/template_tests/test_parser.py
parent55b9bff07f6e2eca7c909d1804dc64553e866622 (diff)
Fixed #7557 -- Added type checking to Variable initialization.
Thanks tobias for the suggestion and boblefrag and saz for work on the patch.
Diffstat (limited to 'tests/template_tests/test_parser.py')
-rw-r--r--tests/template_tests/test_parser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/template_tests/test_parser.py b/tests/template_tests/test_parser.py
index 159a240530..8deb11da89 100644
--- a/tests/template_tests/test_parser.py
+++ b/tests/template_tests/test_parser.py
@@ -87,6 +87,10 @@ class ParserTests(TestCase):
Variable, "article._hidden"
)
+ # Variables should raise on non string type
+ with six.assertRaisesRegex(self, TypeError, "Variable must be a string or number, got <(class|type) 'dict'>"):
+ Variable({})
+
@override_settings(DEBUG=True, TEMPLATE_DEBUG=True)
def test_compile_filter_error(self):
# regression test for #19819