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

Commit f21a5f1

Browse files
committed
testing locally, fix the tier checks and first test
1 parent d26259a commit f21a5f1

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

api/internal/owner/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def update(self, instance: Owner, validated_data: Dict[str, Any]) -> object:
346346
)
347347

348348
sentry_plans = Plan.objects.filter(
349-
tier=TierName.SENTRY.value, is_active=True
349+
tier__tier_name=TierName.SENTRY.value, is_active=True
350350
)
351351

352352
if desired_plan["value"] in sentry_plans:

api/internal/tests/test_pagination.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
from rest_framework.reverse import reverse
22
from rest_framework.test import APITestCase
3+
from shared.django_apps.codecov_auth.tests.factories import PlanFactory, TierFactory
34
from shared.django_apps.core.tests.factories import OwnerFactory
5+
from shared.plan.constants import TierName
46

57
from utils.test_utils import Client
68

79

810
class PageNumberPaginationTests(APITestCase):
911
def setUp(self):
1012
self.client = Client()
11-
self.owner = OwnerFactory(plan="users-free", plan_user_count=5)
13+
tier = TierFactory(tier_name=TierName.BASIC.value)
14+
plan = PlanFactory(tier=tier, is_active=True)
15+
self.owner = OwnerFactory(plan=plan.name, plan_user_count=5)
1216
self.users = [
1317
OwnerFactory(organizations=[self.owner.ownerid]),
1418
OwnerFactory(organizations=[self.owner.ownerid]),

billing/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def on_enterprise_plan(owner: Owner) -> bool:
99
return settings.IS_ENTERPRISE or (
1010
owner.plan
11-
in Plan.objects.filter(tier=TierName.ENTERPRISE.value).values_list(
11+
in Plan.objects.filter(tier__tier_name=TierName.ENTERPRISE.value).values_list(
1212
"name", flat=True
1313
)
1414
)

graphql_api/types/enums/tier_name.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ enum TierName {
33
TEAM
44
PRO
55
ENTERPRISE
6+
SENTRY
7+
TRIAL
68
}

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ freezegun
2626
google-cloud-pubsub
2727
gunicorn>=22.0.0
2828
https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem
29-
https://github.com/codecov/shared/archive/fe16480b3646a616ff412d5c0a28cafd2c7104c1.tar.gz#egg=shared
29+
https://github.com/codecov/shared/archive/3dcd8efa027e6f45e0cbfd2c08a936ec5a68a57c.tar.gz#egg=shared
3030
https://github.com/photocrowd/django-cursor-pagination/archive/f560902696b0c8509e4d95c10ba0d62700181d84.tar.gz
3131
idna>=3.7
3232
minio

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ sentry-sdk[celery]==2.13.0
416416
# shared
417417
setproctitle==1.1.10
418418
# via -r requirements.in
419-
shared @ https://github.com/codecov/shared/archive/fe16480b3646a616ff412d5c0a28cafd2c7104c1.tar.gz
419+
shared @ https://github.com/codecov/shared/archive/3dcd8efa027e6f45e0cbfd2c08a936ec5a68a57c.tar.gz
420420
# via -r requirements.in
421421
simplejson==3.17.2
422422
# via -r requirements.in

0 commit comments

Comments
 (0)