Skip to content

Commit

Permalink
chore: only execute support api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Nov 6, 2024
1 parent 3ff25e8 commit 99d69df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ python-quality-test:
run-tests: python-test python-quality-test

run-integration-tests: install-dev-dependencies
pytest -rPf ./eox_core --ignore-glob='**/unit/*' --ignore-glob='**/edxapp_wrapper/*'
pytest -rPf ./eox_core --ignore-glob='**/unit/*' --ignore-glob='**/edxapp_wrapper/*' --ignore-glob='**/api/v1/*'

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
Expand Down
10 changes: 10 additions & 0 deletions eox_core/api/support/v1/tests/integration/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_delete_user_in_tenant_success(self, query_param: str) -> None:
self.create_user(self.tenant_x, data)

response = self.delete_user(self.tenant_x, {query_param: data[query_param]})
print(f"\n\n{response.text}\n\n")
response_data = response.json()
get_response = self.get_user(self.tenant_x, {"email": data["email"]})
get_response_data = get_response.json()
Expand Down Expand Up @@ -123,6 +124,7 @@ def test_delete_user_in_tenant_not_found(self, query_param: str, value: str) ->
"""
response = self.delete_user(self.tenant_x, {query_param: value})
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(
Expand All @@ -140,6 +142,7 @@ def test_delete_user_missing_required_fields(self) -> None:
"""
response = self.delete_user(self.tenant_x)
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response_data, ["Email or username needed"])
Expand All @@ -165,9 +168,11 @@ def test_update_username_in_tenant_success(self, query_param: str) -> None:
new_username = f"new-username-{query_param}"

response = self.update_username(self.tenant_x, {query_param: data[query_param]}, {"new_username": new_username})
print(f"\n\nResponse text: {response.text}\n\n")
response_data = response.json()
get_response = self.get_user(self.tenant_x, {"username": new_username})
get_response_data = get_response.json()
print(f"\n\nGet response data: {get_response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response_data["username"], new_username)
Expand All @@ -191,6 +196,7 @@ def test_update_username_in_tenant_not_found(self) -> None:
{"new_username": "new-username"},
)
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
self.assertEqual(
Expand All @@ -208,6 +214,7 @@ def test_update_username_in_tenant_missing_params(self) -> None:
"""
response = self.update_username(self.tenant_x)
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response_data, ["Email or username needed"])
Expand All @@ -225,6 +232,7 @@ def test_update_username_in_tenant_missing_body(self) -> None:

response = self.update_username(self.tenant_x, params={"username": data["username"]})
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response_data, {"new_username": ["This field is required."]})
Expand Down Expand Up @@ -267,6 +275,7 @@ def test_create_oauth_application_in_tenant_success(self, create_user: bool) ->

response = self.create_oauth_application(self.tenant_x, data)
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response_data["user"], {"email": user_data["email"], "username": user_data["username"]})
Expand All @@ -286,6 +295,7 @@ def test_create_oauth_application_in_tenant_missing_required_fields(self) -> Non
"""
response = self.create_oauth_application(self.tenant_x)
response_data = response.json()
print(f"\n\nResponse data: {response_data}\n\n")

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(
Expand Down

0 comments on commit 99d69df

Please sign in to comment.