diff --git a/api/Dockerfile b/api/Dockerfile index 9bda1950ec7..11eaf32fdaa 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine AS build +FROM python:3.12.8-alpine3.20 AS build LABEL maintainer="https://github.com/prowler-cloud/api" diff --git a/api/src/backend/api/migrations/0005_update_provider_unique_constraint_with_is_deleted.py b/api/src/backend/api/migrations/0003_update_provider_unique_constraint_with_is_deleted.py similarity index 91% rename from api/src/backend/api/migrations/0005_update_provider_unique_constraint_with_is_deleted.py rename to api/src/backend/api/migrations/0003_update_provider_unique_constraint_with_is_deleted.py index 5fd5097376f..0dd152be342 100644 --- a/api/src/backend/api/migrations/0005_update_provider_unique_constraint_with_is_deleted.py +++ b/api/src/backend/api/migrations/0003_update_provider_unique_constraint_with_is_deleted.py @@ -5,7 +5,7 @@ class Migration(migrations.Migration): dependencies = [ - ("api", "0004_rbac_missing_admin_roles"), + ("api", "0002_token_migrations"), ] operations = [ diff --git a/api/src/backend/api/tests/integration/test_authentication.py b/api/src/backend/api/tests/integration/test_authentication.py index 2b09f05497f..03219cb385b 100644 --- a/api/src/backend/api/tests/integration/test_authentication.py +++ b/api/src/backend/api/tests/integration/test_authentication.py @@ -1,7 +1,8 @@ +from unittest.mock import patch + import pytest from conftest import TEST_PASSWORD, get_api_tokens, get_authorization_header from django.urls import reverse -from unittest.mock import patch from rest_framework.test import APIClient @@ -99,12 +100,11 @@ def test_refresh_token(create_test_user, tenants_fixture): assert new_refresh_response.status_code == 200 +@patch("api.db_router.MainRouter.admin_db", new="default") @pytest.mark.django_db -def test_user_me_when_inviting_users(create_test_user, tenants_fixture, roles_fixture): +def test_user_me_when_inviting_users(create_test_user, tenants_fixture): client = APIClient() - role = roles_fixture[0] - user1_email = "user1@testing.com" user2_email = "user2@testing.com" @@ -135,16 +135,6 @@ def test_user_me_when_inviting_users(create_test_user, tenants_fixture, roles_fi "data": { "type": "invitations", "attributes": {"email": user2_email}, - "relationships": { - "roles": { - "data": [ - { - "type": "roles", - "id": str(role.id), - } - ] - } - }, } }, format="vnd.api+json", diff --git a/api/src/backend/api/tests/integration/test_providers.py b/api/src/backend/api/tests/integration/test_providers.py index 0f17c2d8391..1828dfe4d25 100644 --- a/api/src/backend/api/tests/integration/test_providers.py +++ b/api/src/backend/api/tests/integration/test_providers.py @@ -8,6 +8,7 @@ from api.models import Provider +@patch("api.db_router.MainRouter.admin_db", new="default") @patch("api.v1.views.Task.objects.get") @patch("api.v1.views.delete_provider_task.delay") @pytest.mark.django_db