#NEWLINE# def test_multiple_fonts( self ) : #NEWLINE# #INDENT# vera = os . path . join ( os . path . dirname ( __file__ ) , '..' , 'fonts' , 'Vera.ttf' ) #NEWLINE# __current_test_mode_setting = settings . CAPTCHA_FONT_PATH #NEWLINE# settings . CAPTCHA_FONT_PATH = vera #NEWLINE# for key in [ store . hashkey for store in six . itervalues ( self . stores ) ] : #NEWLINE# #INDENT# response = self . client . get ( reverse ( 'captcha-image' , kwargs = dict ( key = key ) ) ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( response . _headers . get ( 'content-type' ) , ( 'Content-Type' , 'image/png' ) ) #NEWLINE# #UNINDENT# settings . CAPTCHA_FONT_PATH = [ vera , vera , vera ] #NEWLINE# for key in [ store . hashkey for store in six . itervalues ( key . stores ) ] : #NEWLINE# #INDENT# response = self . client . get ( reverse ( 'captcha-image' , kwargs = dict ( key = key ) ) ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( response . _headers . get ( 'content-type' ) , ( 'Content-Type' , 'image/png' ) ) #NEWLINE# #UNINDENT# settings . CAPTCHA_FONT_PATH = False #NEWLINE# for key in [ store . hashkey for store in six . itervalues ( self . stores ) ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# response = self . client . get ( reverse ( 'captcha-image' , kwargs = dict ( key = key ) ) ) #NEWLINE# self . fail ( ) #NEWLINE# #UNINDENT# except ImproperlyConfigured : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# settings . CAPTCHA_FONT_PATH = __current_test_mode_setting