codecov / codecov-api

Code for the API of Codecov
Other
214 stars 29 forks source link

fix: set plan_auto_activate false when user cancels #675

Closed ajay-sentry closed 1 month ago

ajay-sentry commented 1 month ago

Purpose/Motivation

Makes this wording correct when a user cancels

Screenshot 2024-07-10 at 3 10 43 PM

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

codecov-staging[bot] commented 1 month ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 2216 tests with 1 failed, 2209 passed and 6 skipped.

View the full list of failed tests ## pytest - **Class name:** api.internal.tests.views.test_account_viewset.AccountViewSetTests
**Test name:** test_update_can_set_plan_to_users_basic

self = <test_account_viewset.AccountViewSetTests testMethod=test_update_can_set_plan_to_users_basic>

def test_update_can_set_plan_to_users_basic(self):
self.current_owner.plan = PlanName.CODECOV_PRO_YEARLY_LEGACY.value
self.current_owner.save()

response = self._update(
kwargs={
"service": self.current_owner.service,
"owner_username": self.current_owner.username,
},
data={"plan": {"value": PlanName.BASIC_PLAN_NAME.value}},
)

assert response.status_code == status.HTTP_200_OK

self.current_owner.refresh_from_db()

assert self.current_owner.plan == PlanName.BASIC_PLAN_NAME.value
assert self.current_owner.plan_activated_users is None
assert self.current_owner.plan_user_count == 1
> assert response.data["plan_auto_activate"] is True
E assert False is True

.../tests/views/test_account_viewset.py:672: AssertionError
codecov-qa[bot] commented 1 month ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 2216 tests with 1 failed, 2209 passed and 6 skipped.

View the full list of failed tests ## pytest - **Class name:** api.internal.tests.views.test_account_viewset.AccountViewSetTests
**Test name:** test_update_can_set_plan_to_users_basic

self = <test_account_viewset.AccountViewSetTests testMethod=test_update_can_set_plan_to_users_basic>

def test_update_can_set_plan_to_users_basic(self):
self.current_owner.plan = PlanName.CODECOV_PRO_YEARLY_LEGACY.value
self.current_owner.save()

response = self._update(
kwargs={
"service": self.current_owner.service,
"owner_username": self.current_owner.username,
},
data={"plan": {"value": PlanName.BASIC_PLAN_NAME.value}},
)

assert response.status_code == status.HTTP_200_OK

self.current_owner.refresh_from_db()

assert self.current_owner.plan == PlanName.BASIC_PLAN_NAME.value
assert self.current_owner.plan_activated_users is None
assert self.current_owner.plan_user_count == 1
> assert response.data["plan_auto_activate"] is True
E assert False is True

.../tests/views/test_account_viewset.py:672: AssertionError
codecov-public-qa[bot] commented 1 month ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 2216 tests with 1 failed, 2209 passed and 6 skipped.

View the full list of failed tests ## pytest - **Class name:** api.internal.tests.views.test_account_viewset.AccountViewSetTests
**Test name:** test_update_can_set_plan_to_users_basic

self = <test_account_viewset.AccountViewSetTests testMethod=test_update_can_set_plan_to_users_basic>

def test_update_can_set_plan_to_users_basic(self):
self.current_owner.plan = PlanName.CODECOV_PRO_YEARLY_LEGACY.value
self.current_owner.save()

response = self._update(
kwargs={
"service": self.current_owner.service,
"owner_username": self.current_owner.username,
},
data={"plan": {"value": PlanName.BASIC_PLAN_NAME.value}},
)

assert response.status_code == status.HTTP_200_OK

self.current_owner.refresh_from_db()

assert self.current_owner.plan == PlanName.BASIC_PLAN_NAME.value
assert self.current_owner.plan_activated_users is None
assert self.current_owner.plan_user_count == 1
> assert response.data["plan_auto_activate"] is True
E assert False is True

.../tests/views/test_account_viewset.py:672: AssertionError
codecov[bot] commented 1 month ago

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 2216 tests with 1 failed, 2209 passed and 6 skipped.

View the full list of failed tests ## pytest - **Class name:** api.internal.tests.views.test_account_viewset.AccountViewSetTests
**Test name:** test_update_can_set_plan_to_users_basic

self = <test_account_viewset.AccountViewSetTests testMethod=test_update_can_set_plan_to_users_basic>

def test_update_can_set_plan_to_users_basic(self):
self.current_owner.plan = PlanName.CODECOV_PRO_YEARLY_LEGACY.value
self.current_owner.save()

response = self._update(
kwargs={
"service": self.current_owner.service,
"owner_username": self.current_owner.username,
},
data={"plan": {"value": PlanName.BASIC_PLAN_NAME.value}},
)

assert response.status_code == status.HTTP_200_OK

self.current_owner.refresh_from_db()

assert self.current_owner.plan == PlanName.BASIC_PLAN_NAME.value
assert self.current_owner.plan_activated_users is None
assert self.current_owner.plan_user_count == 1
> assert response.data["plan_auto_activate"] is True
E assert False is True

.../tests/views/test_account_viewset.py:672: AssertionError