Skip to content

Commit c3d6e07

Browse files
committed
Django 5.0 will start outputting forms without tables by default
1 parent 7aefea4 commit c3d6e07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/panels/test_template.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import django
12
from django.contrib.auth.models import User
23
from django.template import Context, RequestContext, Template
34
from django.test import override_settings
@@ -47,7 +48,10 @@ def test_template_repr(self):
4748

4849
User.objects.create(username="admin")
4950
bad_repr = TemplateReprForm()
50-
t = Template("<table>{{ bad_repr }}</table>")
51+
if django.VERSION < (5,):
52+
t = Template("<table>{{ bad_repr }}</table>")
53+
else:
54+
t = Template("{{ bad_repr }}")
5155
c = Context({"bad_repr": bad_repr})
5256
html = t.render(c)
5357
self.assertIsNotNone(html)

0 commit comments

Comments
 (0)