Files
sentinel/tests/sentry/web/frontend/test_reactivate_account.py
2024-02-15 17:01:50 +00:00

31 lines
842 B
Python

from functools import cached_property
from django.urls import reverse
from sentry.testutils.cases import TestCase
from sentry.testutils.silo import control_silo_test
@control_silo_test
class ReactivateAccountTest(TestCase):
@cached_property
def path(self):
return reverse("sentry-reactivate-account")
def test_renders(self):
user = self.create_user("[email protected]", is_active=False)
self.login_as(user)
resp = self.client.get(self.path)
assert resp.status_code == 200
self.assertTemplateUsed(resp, "sentry/reactivate-account.html")
def test_does_reactivate(self):
user = self.create_user("[email protected]", is_active=False)
self.login_as(user)
resp = self.client.post(self.path, data={"op": "confirm"})
assert resp.status_code == 302