1
0
mirror of https://github.com/django/django.git synced 2024-11-18 07:26:04 +00:00
django/tests/template_tests/test_base.py
Claude Paroz 9ec7d8e514 Fixed #28730 -- Fixed loss of precision for large integer literals in templates
Thanks Fraser Nevett for the report and Tim Graham for patch edits.
2017-10-21 17:20:29 +02:00

14 lines
515 B
Python

from django.template.base import Variable, VariableDoesNotExist
from django.test import SimpleTestCase
class VariableDoesNotExistTests(SimpleTestCase):
def test_str(self):
exc = VariableDoesNotExist(msg='Failed lookup in %r', params=({'foo': 'bar'},))
self.assertEqual(str(exc), "Failed lookup in {'foo': 'bar'}")
class VariableTests(SimpleTestCase):
def test_integer_literals(self):
self.assertEqual(Variable('999999999999999999999999999').literal, 999999999999999999999999999)