1
0
mirror of https://github.com/django/django.git synced 2025-04-08 07:26:41 +00:00

Fixed invalid HTML in test templates.

This commit is contained in:
Thibaut Decombe 2025-01-11 18:37:52 +01:00 committed by Sarah Boyce
parent c41d6c9bb8
commit 98767ba2ec
3 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1,3 @@
{{ field.label_tag }}
<p>Custom Field<p>
<p>Custom Field</p>
{{ field }}

View File

@ -5371,7 +5371,7 @@ class TemplateTests(SimpleTestCase):
f = MyForm()
self.assertHTMLEqual(
f.render(),
'<div><label for="id_first_name">First name:</label><p>Custom Field<p>'
'<div><label for="id_first_name">First name:</label><p>Custom Field</p>'
'<input type="text" name="first_name" required id="id_first_name"></div>',
)
@ -5382,7 +5382,7 @@ class TemplateTests(SimpleTestCase):
f = MyForm()
self.assertHTMLEqual(
f["first_name"].render(template_name="forms_tests/custom_field.html"),
'<label for="id_first_name">First name:</label><p>Custom Field<p>'
'<label for="id_first_name">First name:</label><p>Custom Field</p>'
'<input type="text" name="first_name" required id="id_first_name">',
)
@ -5410,7 +5410,7 @@ class OverrideTests(SimpleTestCase):
html = t.render(Context({"form": Person()}))
expected = """
<label for="id_first_name">First name:</label>
<p>Custom Field<p>
<p>Custom Field</p>
<input type="text" name="first_name" required id="id_first_name">
"""
self.assertHTMLEqual(html, expected)

View File

@ -2,6 +2,7 @@
<head>
<script src="/jsi18n/app1/"></script>
<script src="/jsi18n/app2/"></script>
</head>
<body>
<p id="app1string">
<script>