Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 4540a4c

Browse files
authored
dev: Swap Transaction Test case for Test Case in api/internal tests (#1073)
1 parent d83d8d9 commit 4540a4c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

api/internal/tests/views/test_self_hosted_user_viewset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from unittest.mock import patch
22

3-
from django.test import TransactionTestCase, override_settings
3+
from django.test import TestCase, override_settings
44
from rest_framework.reverse import reverse
55
from shared.django_apps.core.tests.factories import OwnerFactory
66

@@ -10,15 +10,15 @@
1010

1111

1212
@override_settings(IS_ENTERPRISE=True, ROOT_URLCONF="api.internal.enterprise_urls")
13-
class UserViewsetUnauthenticatedTestCase(TransactionTestCase):
13+
class UserViewsetUnauthenticatedTestCase(TestCase):
1414
def test_list_users(self):
1515
res = self.client.get(reverse("selfhosted-users-list"))
1616
# not authenticated
1717
assert res.status_code == 401
1818

1919

2020
@override_settings(IS_ENTERPRISE=True, ROOT_URLCONF="api.internal.enterprise_urls")
21-
class UserViewsetTestCase(TransactionTestCase):
21+
class UserViewsetTestCase(TestCase):
2222
def setUp(self):
2323
self.owner = OwnerFactory()
2424
self.current_owner = OwnerFactory(organizations=[self.owner.ownerid])

api/internal/tests/views/test_user_viewset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from rest_framework import status
55
from rest_framework.reverse import reverse
6-
from rest_framework.test import APITransactionTestCase
6+
from rest_framework.test import APITestCase
77
from shared.django_apps.core.tests.factories import (
88
OwnerFactory,
99
PullFactory,
@@ -14,7 +14,7 @@
1414
from utils.test_utils import APIClient
1515

1616

17-
class UserViewSetTests(APITransactionTestCase):
17+
class UserViewSetTests(APITestCase):
1818
def setUp(self):
1919
non_org_active_user = OwnerFactory()
2020
self.current_owner = OwnerFactory(

codecov/tests/base_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
22

33
from django.conf import settings
4-
from django.test import TransactionTestCase
4+
from django.test import TestCase
55

66

7-
class InternalAPITest(TransactionTestCase):
7+
class InternalAPITest(TestCase):
88
@classmethod
99
def setUpClass(cls):
1010
super().setUpClass()

services/tests/test_repo_providers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
import pytest
55
from django.conf import settings
6+
from django.test import TransactionTestCase
67
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
78
from shared.torngit import Bitbucket, Github, Gitlab
89

910
from codecov.db import sync_to_async
10-
from codecov.tests.base_test import InternalAPITest
1111
from codecov_auth.models import (
1212
GITHUB_APP_INSTALLATION_DEFAULT_NAME,
1313
GithubAppInstallation,
@@ -114,7 +114,7 @@ def test_token_refresh_callback_none_cases(should_have_owner, service, db):
114114
assert get_token_refresh_callback(owner, service) is None
115115

116116

117-
class TestRepoProviderService(InternalAPITest):
117+
class TestRepoProviderService(TransactionTestCase):
118118
def setUp(self):
119119
self.repo_gh = RepositoryFactory.create(
120120
author__unencrypted_oauth_token="testaaft3ituvli790m1yajovjv5eg0r4j0264iw",

0 commit comments

Comments
 (0)