Skip to content
This repository
tag: 0.8
Fetching contributors…

Cannot retrieve contributors at this time

file 30 lines (23 sloc) 0.838 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
from pyjamas.ui.RootPanel import RootPanel
from pyjamas import DOM

from UnitTest import UnitTest

from __pyjamas__ import doc

class DOMTest(UnitTest):

    def testDivHTML(self):
        e = DOM.getElementById('tests')
        div = DOM.createElement('div')
        DOM.appendChild(e, div)
        DOM.setInnerHTML(div, 'hello world\n')
        self.write_test_output('addDiv')

        DOM.removeChild(e, div)
        self.write_test_output('removeDiv')

    def testDivText(self):
        e = DOM.getElementById('tests')
        div = DOM.createElement('div')
        DOM.appendChild(e, div)
        div2 = DOM.createElement('div')
        DOM.appendChild(div, div2)
        DOM.setInnerText(div2, 'hello world\n')
        self.write_test_output('addDiv')

        DOM.removeChild(e, div)
        self.write_test_output('removeDiv')
Something went wrong with that request. Please try again.