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
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user