forked from GithubBackups/healthchecks
Fix tests.
This commit is contained in:
parent
dd188064fa
commit
b92b0db087
@ -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…
x
Reference in New Issue
Block a user