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

Refactor info test

parent 7c0bd209
No related branches found
No related tags found
1 merge request!11Add tests on json export
Pipeline #269668 passed
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
...@@ -556,17 +556,16 @@ class JSONExportTest(TestCase): ...@@ -556,17 +556,16 @@ class JSONExportTest(TestCase):
self.assertEqual( self.assertEqual(
self.export_dict["participants"], [], "Empty participant list expected" self.export_dict["participants"], [], "Empty participant list expected"
) )
info_keys = {"title": "name", "slug": "slug"}
for attr in ["contact_email", "place"]:
if hasattr(self.event, attr) and getattr(self.event, attr):
info_keys[attr] = attr
self.assertEqual( self.assertEqual(
self.export_dict["info"].keys(), self.export_dict["info"].keys(), info_keys.keys(), "info keys not as expected"
{"title", "slug", "place", "contact_email"},
"info keys not as expected",
)
self.assertEqual(self.event.name, self.export_dict["info"]["title"])
self.assertEqual(self.event.slug, self.export_dict["info"]["slug"])
self.assertEqual(self.event.place, self.export_dict["info"]["place"])
self.assertEqual(
self.event.contact_email, self.export_dict["info"]["contact_email"]
) )
for attr, attr_field in info_keys.items():
self.assertEqual(getattr(self.event, attr_field), self.export_dict["info"][attr])
_check_uniqueness(self.export_dict["aks"], "AK") _check_uniqueness(self.export_dict["aks"], "AK")
_check_uniqueness(self.export_dict["rooms"], "Room") _check_uniqueness(self.export_dict["rooms"], "Room")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment