diff --git a/django/views/templates/default_urlconf.html b/django/views/templates/default_urlconf.html index bda2677eeb3d..294088e1ced7 100644 --- a/django/views/templates/default_urlconf.html +++ b/django/views/templates/default_urlconf.html @@ -114,8 +114,8 @@ .option svg { width: 1.5rem; height: 1.5rem; - fill: light-dark(gray, white); - border: 1px solid #d6d6d6; + fill: currentColor; + border: 1px solid currentColor; padding: 5px; border-radius: 100%; } diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index 439faff84eba..566e898f0e20 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -11,6 +11,7 @@ from asgiref.sync import async_to_sync, iscoroutinefunction +from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection @@ -18,6 +19,7 @@ from django.shortcuts import render from django.template import TemplateDoesNotExist from django.test import RequestFactory, SimpleTestCase, override_settings +from django.test.selenium import SeleniumTestCase, screenshot_cases from django.test.utils import LoggingCaptureMixin from django.urls import path, reverse from django.urls.converters import IntConverter @@ -497,6 +499,22 @@ def test_template_override_exception_reporter(self): self.assertContains(response, "Oh dear, an error occurred!", status_code=500) +@override_settings(ROOT_URLCONF="view_tests.default_urls", DEBUG=True) +class DebugViewVisualTests(SeleniumTestCase, StaticLiveServerTestCase): + available_apps = ["django.contrib.admin"] + + @screenshot_cases(["desktop_size", "mobile_size", "dark", "high_contrast"]) + def test_congratulations_page(self): + from selenium.webdriver.common.by import By + + self.selenium.get(self.live_server_url) + h1 = self.selenium.find_element(By.TAG_NAME, "h1") + self.assertEqual(h1.text, "The install worked successfully! Congratulations!") + self.take_screenshot("top") + self.selenium.execute_script("window.scrollTo(0, document.body.scrollHeight);") + self.take_screenshot("bottom") + + class DebugViewQueriesAllowedTests(SimpleTestCase): # May need a query to initialize MySQL connection databases = {"default"}