def test_escape(self):
     self.assertEqual(escape(None), '')
     self.assertEqual(escape(42), '42')
     self.assertEqual(escape('<>'), '&lt;&gt;')
     self.assertEqual(escape('"foo"'), '"foo"')
     self.assertEqual(escape('"foo"', True), '&quot;foo&quot;')
Esempio n. 2
0
 def test_escape(self):
     self.assertEqual(escape(None), "")
     self.assertEqual(escape(42), "42")
     self.assertEqual(escape("<>"), "&lt;&gt;")
     self.assertEqual(escape('"foo"'), '"foo"')
     self.assertEqual(escape('"foo"', True), "&quot;foo&quot;")
def test_escape():
    assert escape(None) == ''
    assert escape(42) == '42'
    assert escape('<>') == '&lt;&gt;'
    assert escape('"foo"') == '"foo"'
    assert escape('"foo"', True) == '&quot;foo&quot;'