def test_html_attribute_normal(self): self.assertEqual('https://trac.edgewall.org', html_attribute('src', 'https://trac.edgewall.org')) self.assertEqual(None, html_attribute('src', None))
def test_html_attribute_special_false_true(self): self.assertEqual('true', html_attribute('spellcheck', True)) self.assertEqual('false', html_attribute('spellcheck', False)) self.assertEqual('false', html_attribute('spellcheck', None))
def test_html_attribute_special_no_yes(self): self.assertEqual('yes', html_attribute('translate', True)) self.assertEqual('no', html_attribute('translate', False)) self.assertEqual('no', html_attribute('translate', None))
def test_html_attribute_special_off_on(self): self.assertEqual('on', html_attribute('autocomplete', True)) self.assertEqual('off', html_attribute('autocomplete', False)) self.assertEqual('off', html_attribute('autocomplete', None))
def test_html_attribute_special_None(self): self.assertEqual('async', html_attribute('async', True)) self.assertEqual(None, html_attribute('async', False)) self.assertEqual(None, html_attribute('async', None))