feat: add favicon support with SVG response and update templates and tests
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s

- Implemented a `favicon` view to serve a custom SVG favicon
- Added `favicon.ico` route to `urls.py`
- Updated `base.html` to include favicon link tag
- Suppressed specific Django ASGI warnings in DEBUG mode
- Added unit tests to verify favicon behavior and response
This commit is contained in:
2026-04-21 17:56:12 +02:00
parent c4eb40f265
commit dab33a03a1
5 changed files with 43 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
from django.core import mail
from django.test import TestCase, override_settings
from django.test import SimpleTestCase, TestCase, override_settings
from django.urls import reverse
@@ -36,3 +36,12 @@ class FaqQuestionTests(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(len(mail.outbox), 0)
self.assertContains(response, "Необходимо согласие на обработку персональных данных.")
class FaviconTests(SimpleTestCase):
def test_favicon_route_returns_icon(self):
response = self.client.get(reverse("favicon"))
self.assertEqual(response.status_code, 200)
self.assertEqual(response["Content-Type"], "image/svg+xml")
self.assertIn(b"<svg", response.content)