MCPcopy
hub / github.com/django/django / test_input_element_font

Method test_input_element_font

tests/admin_views/tests.py:7023–7051  ·  view source on GitHub ↗

Browsers' default stylesheets override the font of inputs. The admin adds additional CSS to handle this.

(self)

Source from the content-addressed store, hash-verified

7021 self.assertEqual(value, str(parent2.pk))
7022
7023 def test_input_element_font(self):
7024 """
7025 Browsers' default stylesheets override the font of inputs. The admin
7026 adds additional CSS to handle this.
7027 """
7028 from selenium.webdriver.common.by import By
7029
7030 self.selenium.get(self.live_server_url + reverse("admin:login"))
7031 element = self.selenium.find_element(By.ID, "id_username")
7032 # Some browsers quotes the fonts, some don't.
7033 fonts = [
7034 font.strip().strip('"')
7035 for font in element.value_of_css_property("font-family").split(",")
7036 ]
7037 self.assertEqual(
7038 fonts,
7039 [
7040 "Segoe UI",
7041 "system-ui",
7042 "Roboto",
7043 "Helvetica Neue",
7044 "Arial",
7045 "sans-serif",
7046 "Apple Color Emoji",
7047 "Segoe UI Emoji",
7048 "Segoe UI Symbol",
7049 "Noto Color Emoji",
7050 ],
7051 )
7052
7053 def test_search_input_filtered_page(self):
7054 from selenium.webdriver.common.by import By

Callers

nothing calls this directly

Calls 3

reverseFunction · 0.90
getMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected