Example #1
0
 def test_render_escape(self):
     node = TextNode(self.doc, '<div>"hello"</div>')
     test.assert_equal(node.render(), '&lt;div&gt;"hello"&lt;/div&gt;')
     node = TextNode(self.doc, '<div>"hello"</div>', safe=True)
     test.assert_equal(node.render(), '<div>"hello"</div>')
Example #2
0
 def test_render(self):
     node = TextNode(self.doc, 'hello world')
     test.assert_equal(node.render(), 'hello world')
Example #3
0
 def test_render(self):
     node = TextNode(self.doc, 'hello world')
     test.assert_equal(node.render(), 'hello world')
Example #4
0
 def test_render_escape(self):
     node = TextNode(self.doc, '<div>"hello"</div>')
     test.assert_equal(node.render(), '&lt;div&gt;"hello"&lt;/div&gt;')
     node = TextNode(self.doc, '<div>"hello"</div>', safe=True)
     test.assert_equal(node.render(), '<div>"hello"</div>')
Example #5
0
 def test_repr(self):
     node = TextNode(self.doc, 'hello world')
     test.assert_equal(repr(node), 'TextNode(hello world)')