Browse Source

Fix tests.

pull/27/head
Pēteris Caune 9 years ago
parent
commit
b92b0db087
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      hc/accounts/tests/test_check_token.py

+ 7
- 1
hc/accounts/tests/test_check_token.py View File

@ -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/")


Loading…
Cancel
Save