Skip to content

Commit 55ce27c

Browse files
committed
Strengthen segment cross-project creation test
1 parent 9d669cf commit 55ce27c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/tests/unit/segments/test_unit_segments_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ def test_create_segment__body_project_differs_from_url__does_not_create_in_other
18951895
other_project = Project.objects.create(name="Other Project", organisation=other_org)
18961896

18971897
# When
1898-
admin_client.post(
1898+
response = admin_client.post(
18991899
f"/api/v1/projects/{project.id}/segments/",
19001900
data={
19011901
"name": "a_wild_pokemon",
@@ -1906,4 +1906,6 @@ def test_create_segment__body_project_differs_from_url__does_not_create_in_other
19061906
)
19071907

19081908
# Then
1909+
assert response.status_code == status.HTTP_201_CREATED
1910+
assert Segment.objects.filter(project=project, name="a_wild_pokemon").exists()
19091911
assert not Segment.objects.filter(project=other_project).exists()

0 commit comments

Comments
 (0)