示例#1
0
    def test_notes(self):
        """
        L{tree.notes} inserts some additional markup before the first child of
        any node with the I{note} class.
        """
        parent = dom.Element("div")
        noteworthy = dom.Element("span")
        noteworthy.setAttribute("class", "note")
        noteworthy.appendChild(dom.Element("foo"))
        parent.appendChild(noteworthy)

        tree.notes(parent)

        self.assertEqual(noteworthy.toxml(), '<span class="note"><strong>Note: </strong><foo/></span>')
示例#2
0
    def test_notes(self):
        """
        L{tree.notes} inserts some additional markup before the first child of
        any node with the I{note} class.
        """
        parent = dom.Element('div')
        noteworthy = dom.Element('span')
        noteworthy.setAttribute('class', 'note')
        noteworthy.appendChild(dom.Element('foo'))
        parent.appendChild(noteworthy)

        tree.notes(parent)

        self.assertEqual(
            noteworthy.toxml(),
            '<span class="note"><strong>Note: </strong><foo/></span>')