1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Added tests for various __repr__() methods.

This commit is contained in:
Mads Jensen
2017-02-04 11:43:14 +01:00
committed by Tim Graham
parent 2d899ce16b
commit ce69a421f6
6 changed files with 69 additions and 1 deletions

View File

@@ -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>')