Test looking up descendant by id.
(self)
| 490 | assert sliced[1].innerHTML == "Child 2" |
| 491 | |
| 492 | def test_getitem_by_id(self): |
| 493 | """Test looking up descendant by id.""" |
| 494 | child = web.p("Child", id="child-id") |
| 495 | parent = web.div(child) |
| 496 | web.page.body.append(parent) |
| 497 | |
| 498 | result = parent["child-id"] |
| 499 | assert result is not None |
| 500 | assert result.id == "child-id" |
| 501 | |
| 502 | def test_getitem_by_id_with_hash(self): |
| 503 | """Test looking up descendant by id with # prefix.""" |