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
5 merge requests!262[WIP] compatibility with koma solver import/export,!261[WIP] compatibility with koma solver import/export,!260[WIP] import/export merge,!259Add view to clear schedule,!235Merge fork for interoperability of KoMa solver
......@@ -1075,6 +1075,7 @@ class AKSlot(models.Model):
"reso": self.ak.reso,
"duration_in_hours": float(self.duration),
"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):
"reso",
"duration_in_hours",
"django_ak_id",
"types",
},
f"{item} info keys not as expected",
)
......@@ -445,6 +446,10 @@ class JSONExportTest(TestCase):
)
self.assertEqual(ak["info"]["description"], slot.ak.description)
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):
"""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.
Finish editing this message first!
Please register or to comment