summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-05-02 15:16:39 -0700
committerCarlton Gibson <carlton@noumenal.es>2020-06-25 11:46:05 +0200
commit60db8b7b376c107d7bd5068b713e783e52d134bc (patch)
tree64e74726e7b343fab2cb3cee6e9bdc5d44ba74e2 /tests
parente13cfc6dfd4212ef7a40db1a41d3ae6ac4b97de0 (diff)
Removed unnecessary admin CSS.
The "object-tools" container is never rendered as a descendant of .form-row. The "golink" CSS class is unused. A <label> element has not been included in the login .submit-row since 5869afe32b9c252cacd327f18c58e38c36d1f530. The "help" CSS class from login.css has been unused since 0e5faf225c5cd1acf2ab653c74f5b161470403b9. The <label> color in login.css is already inherited from the <body> element and so does not need to be re-specified. The #content-main container already has the property 'width: 100%' from base.css and so does not need to be re-specified in login.css. The <td> and <th> font-family property is inherited from the <body> element and so does not need to be re-specified. The <html> element has the attribute dir which automatically sets the text direction in the layout. Adding the direction CSS property was necessary to support IE which does not support the dir attribute, but IE is no longer supported, so drop the direction property. The 'font-size: 1em' property re-specifies the same font size. It creates no visual difference. The 'font-size: 14px' property often re-specifies the inherited value. Avoid re-specifying it.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_views/tests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 5fe6919ea8..a3a60ba181 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -4822,6 +4822,23 @@ class SeleniumTests(AdminSeleniumTestCase):
value = self.selenium.find_element_by_id('id_form-0-parent').get_attribute('value')
self.assertEqual(value, str(parent2.pk))
+ def test_input_element_font(self):
+ """
+ Browsers' default stylesheets override the font of inputs. The admin
+ adds additional CSS to handle this.
+ """
+ self.selenium.get(self.live_server_url + reverse('admin:login'))
+ element = self.selenium.find_element_by_id('id_username')
+ # Some browsers quotes the fonts, some don't.
+ fonts = [
+ font.strip().strip('"')
+ for font in element.value_of_css_property('font-family').split(',')
+ ]
+ self.assertEqual(
+ fonts,
+ ['Roboto', 'Lucida Grande', 'Verdana', 'Arial', 'sans-serif'],
+ )
+
@override_settings(ROOT_URLCONF='admin_views.urls')
class ReadonlyTest(AdminFieldExtractionMixin, TestCase):