def test_string_namespaced_attributes(self):
     bs_elt = DOMString.create_tag("svg")
     DOMString.append_child(
         bs_elt, DOMString.create_tag("use", {"xlink:href": "test"}))
     self.assertEqual(
         DOMString.render_debug(bs_elt),
         '<svg><use xlink:href="test"></use></svg>',
     )
 def test_append_child_identical_text(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, 'test')
     DOMString.append_child(parent, 'test')
     self.assertEqual(DOMString.render_debug(parent), '<p>testtest</p>')
 def test_string_invalid_attributes(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('div', {'*ngFor': 'test'})), '<div *ngFor="test"></div>')
Esempio n. 4
0
 def test_append_child_identical_elements(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, DOMString.create_tag('br'))
     DOMString.append_child(parent, DOMString.create_tag('br'))
     self.assertEqual(DOMString.render_debug(parent), '<p><br/><br/></p>')
Esempio n. 5
0
 def test_append_child(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, DOMString.create_tag('span', {}))
     self.assertEqual(DOMString.render_debug(parent), '<p><span></span></p>')
 def test_string_html_escaping(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.create_tag("img", {"alt": "< \" ' < > &"})),
         '<img alt="&lt; &quot; &#x27; &lt; &gt; &amp;"/>',
     )
 def test_string_invalid_attributes(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.create_tag("div", {"*ngFor": "test"})),
         '<div *ngFor="test"></div>',
     )
 def test_string_html_parsing(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.parse_html('<p>Invalid > " &</p>')),
         '<p>Invalid > " &</p>',
     )
Esempio n. 9
0
 def test_string_html_escaping(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.create_tag('img', {
                 'alt': '< " \' < > &',
             })), '<img alt="&lt; &quot; &#x27; &lt; &gt; &amp;"/>')
Esempio n. 10
0
 def test_string_namespaced_attributes(self):
     bs_elt = DOMString.create_tag('svg')
     DOMString.append_child(
         bs_elt, DOMString.create_tag('use', {'xlink:href': 'test'}))
     self.assertEqual(DOMString.render_debug(bs_elt),
                      '<svg><use xlink:href="test"></use></svg>')
Esempio n. 11
0
 def test_string_invalid_attributes(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.create_tag('div', {'*ngFor': 'test'})),
         '<div *ngFor="test"></div>')
Esempio n. 12
0
 def test_string_self_closing_tags(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('hr')),
                      '<hr/>')
 def test_string_html_parsing(self):
     self.assertEqual(DOMString.render_debug(DOMString.parse_html('<p>Invalid > " &</p>')), '<p>Invalid > " &</p>')
 def test_string_html_escaping(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('img', {
         'alt': '< " \' < > &',
     })), '<img alt="&lt; &quot; &#x27; &lt; &gt; &amp;"/>')
 def test_string_namespaced_attributes(self):
     bs_elt = DOMString.create_tag('svg')
     DOMString.append_child(bs_elt, DOMString.create_tag('use', {'xlink:href': 'test'}))
     self.assertEqual(DOMString.render_debug(bs_elt), '<svg><use xlink:href="test"></use></svg>')
 def test_append_child_identical_elements(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, DOMString.create_tag('br'))
     DOMString.append_child(parent, DOMString.create_tag('br'))
     self.assertEqual(DOMString.render_debug(parent), '<p><br/><br/></p>')
 def test_create_tag(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('p', {'class': 'intro'})), '<p class="intro"></p>')
 def test_create_tag_empty(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag("p")),
                      "<p></p>")
 def test_string_self_closing_tags(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag("hr")),
                      "<hr/>")
 def test_append_child(self):
     parent = DOMString.create_tag("p")
     DOMString.append_child(parent, DOMString.create_tag("span", {}))
     self.assertEqual(DOMString.render_debug(parent),
                      "<p><span></span></p>")
 def test_append_child_identical_text(self):
     parent = DOMString.create_tag("p")
     DOMString.append_child(parent, DOMString.parse_html("test"))
     DOMString.append_child(parent, DOMString.parse_html("test"))
     self.assertEqual(DOMString.render_debug(parent), "<p>testtest</p>")
 def test_render_debug(self):
     self.assertEqual(
         DOMString.render_debug(
             DOMString.create_tag("p", {"class": "intro"})),
         '<p class="intro"></p>',
     )
Esempio n. 23
0
 def test_create_tag_empty(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('p')), '<p></p>')
 def test_create_tag_empty(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('p')), '<p></p>')
Esempio n. 25
0
 def test_append_child_identical_text(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, DOMString.parse_html('test'))
     DOMString.append_child(parent, DOMString.parse_html('test'))
     self.assertEqual(DOMString.render_debug(parent), '<p>testtest</p>')
 def test_append_child(self):
     parent = DOMString.create_tag('p')
     DOMString.append_child(parent, DOMString.create_tag('span', {}))
     self.assertEqual(DOMString.render_debug(parent), '<p><span></span></p>')
Esempio n. 27
0
 def test_create_tag(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('p', {'class': 'intro'})), '<p class="intro"></p>')
 def test_string_self_closing_tags(self):
     self.assertEqual(DOMString.render_debug(DOMString.create_tag('hr')), '<hr/>')