#NEWLINE# @ patch ( 'defender.config.LOCKOUT_URL' , '/o/login/' ) #NEWLINE# def test_failed_login_redirect_to_URL_local( self ) : #NEWLINE# #INDENT# ' Test to make sure that after lockout we send to the correct\n        redirect URL ' #NEWLINE# for i in range ( 0 , config . FAILURE_LIMIT ) : #NEWLINE# #INDENT# response = self . _login ( ) #NEWLINE# self . assertContains ( response , LOGIN_FORM_KEY ) #NEWLINE# #UNINDENT# lockout_url = 'http://testserver/o/login/' #NEWLINE# if ( DJANGO_VERSION >= StrictVersion ( '1.9' ) ) : #NEWLINE# #INDENT# lockout_url = '/o/login/' #NEWLINE# #UNINDENT# response = self . _login ( ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# self . assertEqual ( response [ 'Location' ] , lockout_url ) #NEWLINE# response = self . client . get ( ADMIN_LOGIN_URL ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# self . assertEqual ( response [ 'Location' ] , lockout_url )