#NEWLINE# def test_test_mode_issue15( self ) : #NEWLINE# #INDENT# __current_test_mode_setting = settings . CAPTCHA_TEST_MODE #NEWLINE# settings . CAPTCHA_TEST_MODE = False #NEWLINE# r = self . client . get ( reverse ( 'captcha-test' ) ) #NEWLINE# self . assertEqual ( r . status_code , 200 ) #NEWLINE# r = self . client . post ( reverse ( 'captcha-test' ) , dict ( captcha_0 = 'abc' , captcha_1 = 'wrong response' , subject = 'xxx' , sender = 'asasd@asdasd.com' ) ) #NEWLINE# self . assertFormError ( r , 'form' , 'captcha' , ugettext_lazy ( 'Invalid CAPTCHA' ) ) #NEWLINE# settings . CAPTCHA_TEST_MODE = True #NEWLINE# r = self . client . get ( reverse ( 'captcha-test' ) ) #NEWLINE# self . assertEqual ( r . status_code , 200 ) #NEWLINE# r = self . client . post ( reverse ( 'captcha-test' ) , dict ( captcha_0 = 'abc' , captcha_1 = 'wrong response' , subject = 'xxx' , sender = 'asasd@asdasd.com' ) ) #NEWLINE# self . assertFormError ( r , 'form' , 'captcha' , ugettext_lazy ( 'Invalid CAPTCHA' ) ) #NEWLINE# r = self . client . get ( reverse ( 'captcha-test' ) ) #NEWLINE# self . assertEqual ( r . status_code , 200 ) #NEWLINE# r = self . client . post ( reverse ( 'captcha-test' ) , dict ( captcha_0 = 'abc' , captcha_1 = 'passed' , subject = 'xxx' , sender = 'asasd@asdasd.com' ) ) #NEWLINE# self . assertTrue ( ( str ( r . content ) . find ( 'Form validated' ) > 0 ) ) #NEWLINE# settings . CAPTCHA_TEST_MODE = r