Skip to content

Commit 6b43466

Browse files
dmartin4820fyliu
authored andcommitted
test project-leadership_type relationship in the API
1 parent c782ebd commit 6b43466

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/core/api/serializers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class Meta:
124124
"github_org_id",
125125
"github_primary_repo_id",
126126
"hide",
127+
"leadership_type",
127128
"google_drive_id",
128129
"image_logo",
129130
"image_hero",

app/core/tests/test_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ def test_create_leadership_type(auth_client):
264264
assert res.data["description"] == payload["description"]
265265

266266

267+
def test_project_leadership_type_relationship(auth_client, project_1, leadership_type):
268+
res = auth_client.patch(
269+
reverse("project-detail", args=[project_1.pk]),
270+
{"leadership_type": leadership_type.pk},
271+
)
272+
assert res.status_code == status.HTTP_200_OK
273+
274+
res = auth_client.get(PROJECTS_URL)
275+
assert res.data[0]["leadership_type"] == leadership_type.pk
276+
277+
267278
def test_create_location(auth_client):
268279
"""Test that we can create a location"""
269280

0 commit comments

Comments
 (0)