Kaydet (Commit) de6d3afb authored tarafından Jon Dufresne's avatar Jon Dufresne Kaydeden (comit) Carlton Gibson

Refs #27804 -- Used subTest() in HTMLEqualTests.test_self_closing_tags.

üst e2feea5f
...@@ -542,17 +542,18 @@ class HTMLEqualTests(SimpleTestCase): ...@@ -542,17 +542,18 @@ class HTMLEqualTests(SimpleTestCase):
'base', 'col', 'base', 'col',
) )
for tag in self_closing_tags: for tag in self_closing_tags:
dom = parse_html('<p>Hello <%s> world</p>' % tag) with self.subTest(tag):
self.assertEqual(len(dom.children), 3) dom = parse_html('<p>Hello <%s> world</p>' % tag)
self.assertEqual(dom[0], 'Hello') self.assertEqual(len(dom.children), 3)
self.assertEqual(dom[1].name, tag) self.assertEqual(dom[0], 'Hello')
self.assertEqual(dom[2], 'world') self.assertEqual(dom[1].name, tag)
self.assertEqual(dom[2], 'world')
dom = parse_html('<p>Hello <%s /> world</p>' % tag)
self.assertEqual(len(dom.children), 3) dom = parse_html('<p>Hello <%s /> world</p>' % tag)
self.assertEqual(dom[0], 'Hello') self.assertEqual(len(dom.children), 3)
self.assertEqual(dom[1].name, tag) self.assertEqual(dom[0], 'Hello')
self.assertEqual(dom[2], 'world') self.assertEqual(dom[1].name, tag)
self.assertEqual(dom[2], 'world')
def test_simple_equal_html(self): def test_simple_equal_html(self):
self.assertHTMLEqual('', '') self.assertHTMLEqual('', '')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment