serve media previews
All checks were successful
Build and Push Docker Image / build (push) Successful in 45s

This commit is contained in:
2026-04-30 16:07:49 +02:00
parent 27187c5e53
commit 812065a34b
2 changed files with 25 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
from django.conf import settings
from django.core import mail
from django.test import SimpleTestCase, TestCase, override_settings
from django.urls import reverse
from django.urls import reverse, resolve
@override_settings(EMAIL_BACKEND="django.core.mail.backends.locmem.EmailBackend", ADMINISTRATOR_EMAIL="admin@example.com")
@@ -45,3 +46,11 @@ class FaviconTests(SimpleTestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response["Content-Type"], "image/svg+xml")
self.assertIn(b"<svg", response.content)
class MediaUrlTests(SimpleTestCase):
def test_media_route_is_registered(self):
match = resolve(f"{settings.MEDIA_URL}items/example.jpg")
self.assertEqual(match.func.__module__, "django.views.static")
self.assertEqual(match.func.__name__, "serve")