Skip to content

Commit

Permalink
Django 5.0 will start outputting forms without tables by default
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jan 20, 2023
1 parent b83713d commit 4344a85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/panels/test_template.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import django
from django.contrib.auth.models import User
from django.template import Context, RequestContext, Template
from django.test import override_settings
Expand Down Expand Up @@ -47,7 +48,10 @@ def test_template_repr(self):

User.objects.create(username="admin")
bad_repr = TemplateReprForm()
t = Template("<table>{{ bad_repr }}</table>")
if django.VERSION < (5,):
t = Template("<table>{{ bad_repr }}</table>")
else:
t = Template("{{ bad_repr }}")
c = Context({"bad_repr": bad_repr})
html = t.render(c)
self.assertIsNotNone(html)
Expand Down

0 comments on commit 4344a85

Please sign in to comment.