serve media previews
All checks were successful
Build and Push Docker Image / build (push) Successful in 45s
All checks were successful
Build and Push Docker Image / build (push) Successful in 45s
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user