def setUp(self): customElements.clear() self.elm = Element('tag') self.c1 = Element('c1') self.c2 = Element('c2') self.c1.classList.add('c1') self.c2.classList.add('c2')
def reset(): """Reset all wdom objects. This function clear all connections, elements, and resistered custom elements. This function also makes new document/application and set them. """ from wdom.document import get_new_document, set_document set_document(get_new_document()) from wdom.server import _tornado _tornado.connections.clear() _tornado.set_application(_tornado.Application()) try: from wdom.server import _aiohttp _aiohttp.connections.clear() _aiohttp.set_application(_aiohttp.Application()) except ImportError: pass Element._elements_with_id.clear() Element._elements.clear() customElements.clear()
def setUp(self): customElements.clear() self.tag = Tag() self.c1 = Tag(c="1") self.c2 = Tag(c="2")