def test_display_override(self): raw = '{{cssxref("the-foo", "foo")}}' ks = CSSxRef(raw=raw, args=['the-foo', 'foo'], scope=self.scope) self.assertEqual( ks.to_html(), ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/' 'the-foo"><code>foo</code></a>'))
def test_standard(self): raw = '{{cssxref("z-index")}}' ks = CSSxRef(raw=raw, args=['z-index'], scope=self.scope) self.assertEqual(ks.api_name, 'z-index') self.assertIsNone(ks.display_name) self.assertEqual( ks.to_html(), ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/' 'z-index"><code>z-index</code></a>')) self.assertEqual(ks.issues, []) self.assertEqual(text_type(ks), raw)
def test_feature_name(self): # https://developer.mozilla.org/en-US/docs/Web/CSS/attr raw = '{{cssxref("content")}}' ks = CSSxRef(raw=raw, args=['content'], scope='compatibility feature') self.assertEqual(ks.to_html(), '<code>content</code>')