def test_is_last(self): doc = mock_document() root = XmlNode(doc, 'html') child_one = XmlNode(doc, 'head').append_to(root) child_two = XmlNode(doc, 'body').append_to(root) test.assert_false(child_one._is_last()) test.assert_true(child_two._is_last())