Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django/views/templates/default_urlconf.html
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
Expand Down
18 changes: 18 additions & 0 deletions tests/view_tests/tests/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@

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
from django.http import Http404, HttpRequest, HttpResponse
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
Expand Down Expand Up @@ -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"}
Expand Down