diff --git a/tests/template_tests/test_base.py b/tests/template_tests/test_base.py index 4012a89f7da..3bc857abeee 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)