33from django .test import TestCase
44from django .utils import timezone
55
6- from .models import Poll , Choice , Vote
6+ from .models import Poll , Vote
77
88
99class PollModelTest (TestCase ):
@@ -24,16 +24,21 @@ def test_home(self):
2424
2525 def test_login (self ):
2626 User .objects .create_user (username = 'john' , password = 'rambo' )
27- response = self .client .post ('/accounts/login/' , {'username' : 'john' , 'password' : 'rambo' })
27+ response = self .client .post (
28+ '/accounts/login/' , {'username' : 'john' , 'password' : 'rambo' }
29+ )
2830 self .assertRedirects (response , '/' )
2931
3032 def test_register (self ):
31- # print(response.context['messages'])
32- response = self .client .post ('/accounts/register/' , {'username' : 'johny' ,
33- 'password1' : 'rambo' ,
34- 'password2' : 'rambo' ,
35- 'email' : 'johny.rambo@usarmy.gov'
36- })
33+ response = self .client .post (
34+ '/accounts/register/' ,
35+ {
36+ 'username' : 'johny' ,
37+ 'password1' : 'rambo' ,
38+ 'password2' : 'rambo' ,
39+ 'email' : 'johny.rambo@usarmy.gov' ,
40+ },
41+ )
3742 self .assertRedirects (response , '/accounts/login/' )
3843 # assert that user got actually created in the backend
3944 self .assertIsNotNone (authenticate (username = 'johny' , password = 'rambo' ))
0 commit comments