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

Commit b77e3a3

Browse files
authored
chore: Move plan constants import to shared (#1000)
1 parent 2ce40e5 commit b77e3a3

File tree

31 files changed

+52
-409
lines changed

31 files changed

+52
-409
lines changed

api/internal/owner/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
from django.conf import settings
77
from rest_framework import serializers
88
from rest_framework.exceptions import PermissionDenied
9-
10-
from codecov_auth.models import Owner
11-
from plan.constants import (
9+
from shared.plan.constants import (
1210
PAID_PLANS,
1311
SENTRY_PAID_USER_PLAN_REPRESENTATIONS,
1412
TEAM_PLAN_MAX_USERS,
1513
TEAM_PLAN_REPRESENTATIONS,
1614
)
15+
16+
from codecov_auth.models import Owner
1717
from plan.service import PlanService
1818
from services.billing import BillingService
1919
from services.sentry import send_user_webhook as send_sentry_webhook

api/internal/tests/views/test_account_viewset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
OwnerFactory,
1515
UserFactory,
1616
)
17+
from shared.plan.constants import PlanName, TrialStatus
1718
from stripe import StripeError
1819

1920
from api.internal.tests.test_utils import GetAdminProviderAdapter
2021
from codecov_auth.models import Service
21-
from plan.constants import PlanName, TrialStatus
2222
from utils.test_utils import APIClient
2323

2424
curr_path = os.path.dirname(__file__)

billing/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.conf import settings
2+
from shared.plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS
23

34
from codecov_auth.models import Owner
4-
from plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS
55

66

77
def on_enterprise_plan(owner: Owner) -> bool:

billing/tests/test_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from django.test import TestCase, override_settings
22
from shared.django_apps.core.tests.factories import OwnerFactory
3+
from shared.plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS
34

45
from billing.helpers import on_enterprise_plan
5-
from plan.constants import ENTERPRISE_CLOUD_USER_PLAN_REPRESENTATIONS
66

77

88
class HelpersTestCase(TestCase):

billing/tests/test_views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from rest_framework.reverse import reverse
1010
from rest_framework.test import APIRequestFactory, APITestCase
1111
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
12-
13-
from plan.constants import PlanName
12+
from shared.plan.constants import PlanName
1413

1514
from ..constants import StripeHTTPHeaders
1615

codecov_auth/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
InvoiceBilling,
2020
StripeBilling,
2121
)
22+
from shared.plan.constants import USER_PLAN_REPRESENTATIONS
2223

2324
from codecov.admin import AdminMixin
2425
from codecov.commands.exceptions import ValidationError
2526
from codecov_auth.helpers import History
2627
from codecov_auth.models import OrganizationLevelToken, Owner, SentryUser, Session, User
2728
from codecov_auth.services.org_level_token_service import OrgLevelTokenService
28-
from plan.constants import USER_PLAN_REPRESENTATIONS
2929
from plan.service import PlanService
3030
from services.task import TaskService
3131
from utils.services import get_short_service_name

codecov_auth/commands/owner/interactors/tests/test_cancel_trial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from django.test import TransactionTestCase
66
from freezegun import freeze_time
77
from shared.django_apps.core.tests.factories import OwnerFactory
8+
from shared.plan.constants import PlanName, TrialStatus
89

910
from codecov.commands.exceptions import Unauthorized, ValidationError
1011
from codecov_auth.models import Owner
11-
from plan.constants import PlanName, TrialStatus
1212

1313
from ..cancel_trial import CancelTrialInteractor
1414

codecov_auth/commands/owner/interactors/tests/test_get_uploads_number_per_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
RepositoryFactory,
88
)
99
from shared.django_apps.reports.models import ReportType
10+
from shared.plan.constants import TrialStatus
1011
from shared.upload.utils import UploaderType, insert_coverage_measurement
1112

12-
from plan.constants import TrialStatus
1313
from reports.tests.factories import CommitReportFactory, UploadFactory
1414

1515
from ..get_uploads_number_per_user import GetUploadsNumberPerUserInteractor

codecov_auth/commands/owner/interactors/tests/test_start_trial.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
from django.test import TransactionTestCase
66
from freezegun import freeze_time
77
from shared.django_apps.core.tests.factories import OwnerFactory
8+
from shared.plan.constants import (
9+
TRIAL_PLAN_SEATS,
10+
PlanName,
11+
TrialDaysAmount,
12+
TrialStatus,
13+
)
814

915
from codecov.commands.exceptions import Unauthorized, ValidationError
1016
from codecov_auth.models import Owner
11-
from plan.constants import TRIAL_PLAN_SEATS, PlanName, TrialDaysAmount, TrialStatus
1217

1318
from ..start_trial import StartTrialInteractor
1419

codecov_auth/management/commands/set_trial_status_values.py

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

33
from django.core.management.base import BaseCommand, CommandParser
44
from django.db.models import Q
5-
6-
from codecov_auth.models import Owner
7-
from plan.constants import (
5+
from shared.plan.constants import (
86
FREE_PLAN_REPRESENTATIONS,
97
PLANS_THAT_CAN_TRIAL,
108
PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS,
@@ -13,6 +11,8 @@
1311
TrialStatus,
1412
)
1513

14+
from codecov_auth.models import Owner
15+
1616

1717
class Command(BaseCommand):
1818
help = "Sets the initial trial status values for an owner"

0 commit comments

Comments
 (0)