-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Missing permissions for LaunchDarkly view (#4531)
- Loading branch information
Showing
2 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,39 @@ def test_launch_darkly_import_request_view__list__wrong_project__return_expected | |
response = api_client.get(url) | ||
|
||
# Then | ||
assert response.status_code == status.HTTP_404_NOT_FOUND | ||
assert response.status_code == status.HTTP_403_FORBIDDEN | ||
|
||
|
||
def test_launch_darkly_import_request_view__list__return_expected( | ||
import_request: LaunchDarklyImportRequest, | ||
project: Project, | ||
admin_client: APIClient, | ||
mocker: MockerFixture, | ||
) -> None: | ||
# Given | ||
url = reverse("api-v1:projects:imports-launch-darkly-list", args=[project.id]) | ||
|
||
# When | ||
response = admin_client.get(url) | ||
|
||
# Then | ||
assert response.status_code == status.HTTP_200_OK | ||
assert response.json() == [ | ||
{ | ||
"completed_at": None, | ||
"created_at": mocker.ANY, | ||
"created_by": "[email protected]", | ||
"id": import_request.id, | ||
"project": project.id, | ||
"status": { | ||
"error_messages": [], | ||
"requested_environment_count": 2, | ||
"requested_flag_count": 9, | ||
"result": None, | ||
}, | ||
"updated_at": mocker.ANY, | ||
}, | ||
] | ||
|
||
|
||
def test_launch_darkly_import_request_view__create__return_expected( | ||
|