From 6c3104221b2cb9f068c07adf3ef24c9f49627834 Mon Sep 17 00:00:00 2001 From: Levi Payne Date: Sat, 21 Oct 2017 20:55:26 -0400 Subject: [PATCH] Refs #28721 -- Added test for variations of 'inf'/'infinity' as a template variable names. Fixed by 9ec7d8e514e09636b0ab4bcac74b5f7a5be335a3. --- tests/template_tests/test_base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/template_tests/test_base.py b/tests/template_tests/test_base.py index 4012a89f7d..3bc857abee 100644 --- a/tests/template_tests/test_base.py +++ b/tests/template_tests/test_base.py @@ -11,3 +11,12 @@ class VariableDoesNotExistTests(SimpleTestCase): class VariableTests(SimpleTestCase): def test_integer_literals(self): self.assertEqual(Variable('999999999999999999999999999').literal, 999999999999999999999999999) + + def test_nonliterals(self): + """Variable names that aren't resolved as literals.""" + var_names = [] + for var in ('inf', 'infinity', 'iNFiniTy', 'nan'): + var_names.extend((var, '-' + var, '+' + var)) + for var in var_names: + with self.subTest(var=var): + self.assertIsNone(Variable(var).literal)