Skip to content
Snippets Groups Projects
Commit da0e1a28 authored by Felix Blanke's avatar Felix Blanke
Browse files

Add AK types to json export

parent 1d0e2aaf
No related branches found
No related tags found
2 merge requests!21Add AK types to json export,!17Add view to clear schedule
Pipeline #274585 passed
...@@ -1075,6 +1075,7 @@ class AKSlot(models.Model): ...@@ -1075,6 +1075,7 @@ class AKSlot(models.Model):
"reso": self.ak.reso, "reso": self.ak.reso,
"duration_in_hours": float(self.duration), "duration_in_hours": float(self.duration),
"django_ak_id": self.ak.pk, "django_ak_id": self.ak.pk,
"types": list(self.ak.types.values_list("name", flat=True).order_by()),
}, },
} }
......
...@@ -143,6 +143,7 @@ class JSONExportTest(TestCase): ...@@ -143,6 +143,7 @@ class JSONExportTest(TestCase):
"reso", "reso",
"duration_in_hours", "duration_in_hours",
"django_ak_id", "django_ak_id",
"types",
}, },
f"{item} info keys not as expected", f"{item} info keys not as expected",
) )
...@@ -445,6 +446,10 @@ class JSONExportTest(TestCase): ...@@ -445,6 +446,10 @@ class JSONExportTest(TestCase):
) )
self.assertEqual(ak["info"]["description"], slot.ak.description) self.assertEqual(ak["info"]["description"], slot.ak.description)
self.assertEqual(ak["info"]["django_ak_id"], slot.ak.pk) self.assertEqual(ak["info"]["django_ak_id"], slot.ak.pk)
self.assertEqual(
ak["info"]["types"],
list(slot.ak.types.values_list("name", flat=True).order_by()),
)
def test_ak_room_constraints(self): def test_ak_room_constraints(self):
"""Test if AK room constraints are exported as expected.""" """Test if AK room constraints are exported as expected."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment