From b92b0db087081762b9f4d2a32ba8fb1573f6cb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 4 Jan 2016 22:47:33 +0200 Subject: [PATCH] Fix tests. --- hc/accounts/tests/test_check_token.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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/")