mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Added tests for various __repr__() methods.
This commit is contained in:
parent
2d899ce16b
commit
ce69a421f6
6 changed files with 69 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from django.template import TemplateSyntaxError
|
||||
from django.template.defaulttags import WithNode
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from ..utils import setup
|
||||
|
|
@ -50,3 +51,9 @@ class WithTagTests(SimpleTestCase):
|
|||
def test_with_error02(self):
|
||||
with self.assertRaises(TemplateSyntaxError):
|
||||
self.engine.render_to_string('with-error02', {'dict': {'key': 50}})
|
||||
|
||||
|
||||
class WithNodeTests(SimpleTestCase):
|
||||
def test_repr(self):
|
||||
node = WithNode(nodelist=[], name='a', var='dict.key')
|
||||
self.assertEqual(repr(node), '<WithNode>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue