diff --git a/tests/test_projects/test_edition_api.py b/tests/test_projects/test_edition_api.py index 48eb5359ef6de191468b21213b227a2eb10ee7b9..f8c5dc1680dabbf6ceebbbc82238734f5ce3ff59 100644 --- a/tests/test_projects/test_edition_api.py +++ b/tests/test_projects/test_edition_api.py @@ -12,7 +12,8 @@ class EditionEndpointsTest(SimpleAPITestCase): factory = EditionFactory read_expected_fields = {'id', 'url', 'name', 'year', 'project', - 'description', 'organizers', 'participations'} + 'description', 'organizers', 'participations', + 'edition_form',} def setUp(self): self.factory.create_batch(3) diff --git a/tests/test_projects/test_participation_api.py b/tests/test_projects/test_participation_api.py index e882bcd59108599063420aaf80464cb44a636230..75422d1795db8c2f9a656416eca968eb878b2947 100644 --- a/tests/test_projects/test_participation_api.py +++ b/tests/test_projects/test_participation_api.py @@ -5,6 +5,7 @@ from tests.utils import SimpleAPITestCase, logged_in from projects.factory import EditionFactory, ParticipationFactory from users.factory import UserFactory +from dynamicforms.models import Form class ParticipationReadTest(SimpleAPITestCase): @@ -58,9 +59,15 @@ class ParticipationCreateTest(SimpleAPITestCase): def perform_create(self): user = UserFactory.create() edition = EditionFactory.create() + form = Form.objects.create(title="What's up?") + entry = { + 'form': form.pk, + 'answers': [], + } payload = { 'user': user.pk, 'edition': edition.pk, + 'entry': entry, } return self.client.post('/api/project-participations/', data=payload, format='json') diff --git a/tests/test_projects/test_project_api.py b/tests/test_projects/test_project_api.py index d897abd6e18d857810ec47f4d59438a3fe1f9592..6b18a9b8fa6b8101fa3044884785e3f64b89e315 100644 --- a/tests/test_projects/test_project_api.py +++ b/tests/test_projects/test_project_api.py @@ -44,7 +44,7 @@ class ProjectEndpointsTest(SimpleAPITestCase): @logged_in def test_retrieve_returns_expected_fields(self): - expected = {'id', 'url', 'name', 'logo', 'description'} + expected = {'id', 'url', 'name', 'logo', 'description', 'editions'} response = self.perform_retrieve() self.assertEqual(response.status_code, status.HTTP_200_OK) fields = set(response.data)