Skip to content

Commit

Permalink
test: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
vicferpoy committed Dec 23, 2024
1 parent fa5155a commit e51e40b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
18 changes: 4 additions & 14 deletions api/src/backend/api/tests/integration/test_authentication.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions api/src/backend/api/tests/integration/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e51e40b

Please sign in to comment.