diff --git a/hc/accounts/tests/test_check_token.py b/hc/accounts/tests/test_check_token.py index 19725b9a..7a7abe95 100644 --- a/hc/accounts/tests/test_check_token.py +++ b/hc/accounts/tests/test_check_token.py @@ -1,6 +1,9 @@ +from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from django.test import TestCase +from hc.accounts.models import Profile + class CheckTokenTestCase(TestCase): @@ -8,9 +11,12 @@ class CheckTokenTestCase(TestCase): super(CheckTokenTestCase, self).setUp() self.alice = User(username="alice") - self.alice.set_password("secret-token") self.alice.save() + self.profile = Profile(user=self.alice) + self.profile.token = make_password("secret-token") + self.profile.save() + def test_it_redirects(self): r = self.client.get("/accounts/check_token/alice/secret-token/") self.assertRedirects(r, "/checks/")