MCPcopy Create free account
hub / github.com/django/code.djangoproject.com / test_has_shadow

Method test_has_shadow

noshadows.py:149–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

147 ) # attr, colon, value, semicolon
148
149 def test_has_shadow(self):
150 for expected, css in [
151 (True, "html {box-shadow: 10px 5px 5px red;}"),
152 (True, "html {text-shadow: 1px 1px 2px pink;}"),
153 (True, "html {text-shadow: 5px 5px #558ABB;}"),
154 (False, "html {box-shadow: none;}"),
155 (False, "html {text-shadow: none;}"),
156 (True, "html {text-shadow: 5px 5px #558ABB; box-shadow: none;}"),
157 (True, "html {text-shadow: none; box-shadow: 10px 5px 5px red;}"),
158 (False, "html {}"),
159 (False, "html {color: red; font-weight: bold;}"),
160 ]:
161 with self.subTest(css=css, expected=expected):
162 (rule,) = parse_stylesheet(css)
163 assert_method = self.assertTrue if expected else self.assertFalse
164 assert_method(has_shadow(rule))
165
166 def test_selector_str_tag(self):
167 (rule,) = parse_stylesheet("html {}")

Callers

nothing calls this directly

Calls 1

has_shadowFunction · 0.85

Tested by

no test coverage detected