mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #27783 -- Switched VariableDoesNotExist.__str__() to repr() context.
Using __str__() and then repr'ing the result looks strange and can lead to recursive rendering of forms.
This commit is contained in:
8
tests/template_tests/test_base.py
Normal file
8
tests/template_tests/test_base.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from django.template.base import 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'}")
|
||||
Reference in New Issue
Block a user