fix: update theatre laboratory details

This commit is contained in:
bisco
2026-06-22 19:56:10 +02:00
parent cff9a17c3c
commit 8155d94fee
8 changed files with 68 additions and 32 deletions
+18 -1
View File
@@ -3,7 +3,7 @@ import tempfile
from django.core.management import call_command
from django.test import TestCase, override_settings
from home.models import GalleryItem, HomePage, Show
from home.models import GalleryItem, HomePage, Show, TeacherProfile
@override_settings(WAGTAILADMIN_BASE_URL="https://cms.example.test")
@@ -36,6 +36,13 @@ class HomeApiTests(TestCase):
},
)
self.assertEqual(payload["homepage"]["hero_title"], "Il teatro diventa presenza.")
self.assertEqual(payload["settings"]["laboratory_name"], "Azione!Lab")
self.assertEqual(payload["settings"]["address"], "Via dell'Epomeo 9999, Napoli")
self.assertEqual(payload["teacher"]["name"], "Ernesto Estatico")
self.assertEqual(
payload["lesson_info"]["location"],
"Spazio Teatro, Via dell'Epomeo 9999, Napoli",
)
self.assertEqual(len(payload["feature_cards"]), 3)
self.assertTrue(
payload["homepage"]["hero_image"]["url"].startswith(
@@ -61,6 +68,16 @@ class HomeApiTests(TestCase):
self.assertEqual(Show.objects.count(), 2)
self.assertEqual(GalleryItem.objects.count(), 4)
def test_seed_updates_the_existing_teacher_without_creating_a_duplicate(self):
teacher = TeacherProfile.objects.get()
teacher.name = "Andrea Rossi"
teacher.save(update_fields=["name"])
call_command("seed_demo", verbosity=0)
self.assertEqual(TeacherProfile.objects.count(), 1)
self.assertEqual(TeacherProfile.objects.get().name, "Ernesto Estatico")
class HealthTests(TestCase):
def test_health_endpoint_checks_database(self):