Skip to content

Commit

Permalink
replace expected http error 400 to 403 in threats and security functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdev8 committed Feb 27, 2024
1 parent f484e32 commit 1a8ee48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backend/app_tests/api/test_api_security_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from rest_framework import status
from rest_framework.status import HTTP_403_FORBIDDEN
from rest_framework.test import APIClient
from core.models import SecurityFunction
from iam.models import Folder
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_update_security_function_with_urn(self, test):
"folder": {"str": Folder.get_root_folder().name},
},
fails=True,
expected_status=status.HTTP_400_BAD_REQUEST, # Imported objects cannot be updated
expected_status=HTTP_403_FORBIDDEN, # Imported objects cannot be updated
user_group=test.user_group,
)

Expand Down
6 changes: 3 additions & 3 deletions backend/app_tests/api/test_api_threats.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from rest_framework.status import HTTP_400_BAD_REQUEST
from rest_framework.status import HTTP_403_FORBIDDEN
from rest_framework.test import APIClient
from core.models import Threat
from iam.models import Folder
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_create_threats(self, test):
user_group=test.user_group,
)

def test_update_threats_with_url(self, test):
def test_update_threats_with_urn(self, test):
"""test to update imported threat (with URN) with the API with authentication"""
folder = Folder.objects.create(name="test2")

Expand All @@ -158,7 +158,7 @@ def test_update_threats_with_url(self, test):
"folder": str(folder.id),
},
fails=True,
expected_status=HTTP_400_BAD_REQUEST, # Imported objects cannot be modified
expected_status=HTTP_403_FORBIDDEN, # Imported objects cannot be modified
user_group=test.user_group,
)

Expand Down

0 comments on commit 1a8ee48

Please sign in to comment.