#NEWLINE# @ patch ( 'defender.config.LOCKOUT_TEMPLATE' , 'defender/lockout.html' ) #NEWLINE# def test_failed_login_redirect_to_template( self ) : #NEWLINE# #INDENT# ' Test to make sure that after lockout we send to the correct\n        template ' #NEWLINE# for i in range ( 0 , config . FAILURE_LIMIT ) : #NEWLINE# #INDENT# response = self . _login ( ) #NEWLINE# self . assertContains ( response , LOGIN_FORM_KEY ) #NEWLINE# #UNINDENT# response = self . _login ( ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertTemplateUsed ( response , 'defender/lockout.html' ) #NEWLINE# response = self . client . get ( ADMIN_LOGIN_URL ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertTemplateUsed ( response , 'defender/lockout.html' )