#NEWLINE# def _login( self , username = None , password = None , user_agent = 'test-browser' , remote_addr = '127.0.0.1' ) : #NEWLINE# #INDENT# ' Login a user. If the username or password is not provided\n        it will use a random string instead. Use the VALID_USERNAME and\n        VALID_PASSWORD to make a valid login.\n        ' #NEWLINE# if ( username is None ) : #NEWLINE# #INDENT# username = self . _get_random_str ( ) #NEWLINE# #UNINDENT# if ( password is None ) : #NEWLINE# #INDENT# password = self . _get_random_str ( ) #NEWLINE# #UNINDENT# response = self . client . post ( ADMIN_LOGIN_URL , { #NEWLINE# #INDENT# 'username' : username , #NEWLINE# 'password' : password , #NEWLINE# LOGIN_FORM_KEY : 1 , #NEWLINE# #UNINDENT# } , HTTP_USER_AGENT = user_agent , REMOTE_ADDR = remote_addr ) #NEWLINE# return response