From 4a5eceae99b4411c0330b8d3b7712ff4bbef53c3 Mon Sep 17 00:00:00 2001 From: Ajay Singh Date: Thu, 26 Dec 2024 10:56:13 -0800 Subject: [PATCH] change out transaction test case for test case --- api/internal/tests/views/test_self_hosted_user_viewset.py | 6 +++--- api/internal/tests/views/test_user_viewset.py | 4 ++-- codecov/tests/base_test.py | 4 ++-- services/tests/test_repo_providers.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/internal/tests/views/test_self_hosted_user_viewset.py b/api/internal/tests/views/test_self_hosted_user_viewset.py index e184d8c315..9bbcdc486c 100644 --- a/api/internal/tests/views/test_self_hosted_user_viewset.py +++ b/api/internal/tests/views/test_self_hosted_user_viewset.py @@ -1,6 +1,6 @@ from unittest.mock import patch -from django.test import TransactionTestCase, override_settings +from django.test import TestCase, override_settings from rest_framework.reverse import reverse from shared.django_apps.core.tests.factories import OwnerFactory @@ -10,7 +10,7 @@ @override_settings(IS_ENTERPRISE=True, ROOT_URLCONF="api.internal.enterprise_urls") -class UserViewsetUnauthenticatedTestCase(TransactionTestCase): +class UserViewsetUnauthenticatedTestCase(TestCase): def test_list_users(self): res = self.client.get(reverse("selfhosted-users-list")) # not authenticated @@ -18,7 +18,7 @@ def test_list_users(self): @override_settings(IS_ENTERPRISE=True, ROOT_URLCONF="api.internal.enterprise_urls") -class UserViewsetTestCase(TransactionTestCase): +class UserViewsetTestCase(TestCase): def setUp(self): self.owner = OwnerFactory() self.current_owner = OwnerFactory(organizations=[self.owner.ownerid]) diff --git a/api/internal/tests/views/test_user_viewset.py b/api/internal/tests/views/test_user_viewset.py index d2763e8f02..f62bb78310 100644 --- a/api/internal/tests/views/test_user_viewset.py +++ b/api/internal/tests/views/test_user_viewset.py @@ -3,7 +3,7 @@ from rest_framework import status from rest_framework.reverse import reverse -from rest_framework.test import APITransactionTestCase +from rest_framework.test import APITestCase from shared.django_apps.core.tests.factories import ( OwnerFactory, PullFactory, @@ -14,7 +14,7 @@ from utils.test_utils import APIClient -class UserViewSetTests(APITransactionTestCase): +class UserViewSetTests(APITestCase): def setUp(self): non_org_active_user = OwnerFactory() self.current_owner = OwnerFactory( diff --git a/codecov/tests/base_test.py b/codecov/tests/base_test.py index 88384db1f4..3eca9ab304 100644 --- a/codecov/tests/base_test.py +++ b/codecov/tests/base_test.py @@ -1,10 +1,10 @@ import json from django.conf import settings -from django.test import TransactionTestCase +from django.test import TestCase -class InternalAPITest(TransactionTestCase): +class InternalAPITest(TestCase): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/services/tests/test_repo_providers.py b/services/tests/test_repo_providers.py index 67dbbd6319..f515fde88e 100644 --- a/services/tests/test_repo_providers.py +++ b/services/tests/test_repo_providers.py @@ -3,11 +3,11 @@ import pytest from django.conf import settings +from django.test import TransactionTestCase from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory from shared.torngit import Bitbucket, Github, Gitlab from codecov.db import sync_to_async -from codecov.tests.base_test import InternalAPITest from codecov_auth.models import ( GITHUB_APP_INSTALLATION_DEFAULT_NAME, GithubAppInstallation, @@ -114,7 +114,7 @@ def test_token_refresh_callback_none_cases(should_have_owner, service, db): assert get_token_refresh_callback(owner, service) is None -class TestRepoProviderService(InternalAPITest): +class TestRepoProviderService(TransactionTestCase): def setUp(self): self.repo_gh = RepositoryFactory.create( author__unencrypted_oauth_token="testaaft3ituvli790m1yajovjv5eg0r4j0264iw",