diff options
| author | David Smith <smithdc@gmail.com> | 2023-07-05 06:51:29 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-07-14 10:25:00 +0200 |
| commit | 1d0dfc0b920916900d2770f3b5640da08af36d97 (patch) | |
| tree | 4989aae4e5faa3e04413161a7914237d7e323797 /tests/test_utils | |
| parent | 6f1b8c00d8151059cc1902a92f067bbdc1673779 (diff) | |
Refs #30686 -- Moved Parser.SELF_CLOSING_TAGS to django.utils.html.VOID_ELEMENTS
Diffstat (limited to 'tests/test_utils')
| -rw-r--r-- | tests/test_utils/tests.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 25218299b2..cdb0453e44 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -46,6 +46,7 @@ from django.test.utils import ( ) from django.urls import NoReverseMatch, path, reverse, reverse_lazy from django.utils.deprecation import RemovedInDjango51Warning +from django.utils.html import VOID_ELEMENTS from django.utils.version import PY311 from .models import Car, Person, PossessedCar @@ -657,27 +658,8 @@ class HTMLEqualTests(SimpleTestCase): self.assertEqual(len(dom.children), 1) self.assertEqual(dom.children[0], "<p>foo</p> '</scr'+'ipt>' <span>bar</span>") - def test_self_closing_tags(self): - self_closing_tags = [ - "area", - "base", - "br", - "col", - "embed", - "hr", - "img", - "input", - "link", - "meta", - "param", - "source", - "track", - "wbr", - # Deprecated tags - "frame", - "spacer", - ] - for tag in self_closing_tags: + def test_void_elements(self): + for tag in VOID_ELEMENTS: with self.subTest(tag): dom = parse_html("<p>Hello <%s> world</p>" % tag) self.assertEqual(len(dom.children), 3) |
