Пример #1
0
 def test_boolean_attribute(self):
     # ability to serialize boolean attribute by setting value to None
     form = html.Element('form')
     form.set('novalidate', None)
     self.assertEqual(html.tostring(form),
                      _bytes('<form novalidate></form>'))
     form.set('custom')
     self.assertEqual(html.tostring(form),
                      _bytes('<form novalidate custom></form>'))
Пример #2
0
 def test_boolean_attribute(self):
     # ability to serialize boolean attribute by setting value to None
     form = html.Element('form')
     form.set('novalidate', None)
     self.assertEqual(html.tostring(form),
                      _bytes('<form novalidate></form>'))
     form.set('custom')
     self.assertEqual(html.tostring(form),
                      _bytes('<form novalidate custom></form>'))
Пример #3
0
 def test_boolean_attribute_round_trip(self):
     # ability to pass boolean attributes unmodified
     fragment = '<tag attribute></tag>'
     self.assertEqual(html.tostring(html.fragment_fromstring(fragment)),
                      _bytes(fragment))
Пример #4
0
 def test_boolean_attribute_round_trip(self):
     # ability to pass boolean attributes unmodified
     fragment = '<tag attribute></tag>'
     self.assertEqual(html.tostring(html.fragment_fromstring(fragment)),
                      _bytes(fragment))