#NEWLINE# def login( self , password = 'password' ) : #NEWLINE# #INDENT# response = self . client . post ( '/login/' , { #NEWLINE# #INDENT# 'username' : 'testclient' , #NEWLINE# 'password' : password , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( self . status_code , 302 ) #NEWLINE# self . assertTrue ( response [ 'Location' ] . endswith ( settings . LOGIN_REDIRECT_URL ) ) #NEWLINE# self . assertTrue ( ( SESSION_KEY in self . client . session ) )