#NEWLINE# def test_modelview_localization( ) : #NEWLINE# #INDENT# def test_locale( locale ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( app , db , admin ) = setup ( ) #NEWLINE# app . config [ 'BABEL_DEFAULT_LOCALE' ] = locale #NEWLINE# babel = Babel ( app ) #NEWLINE# ( Model1 , _ ) = create_models ( db ) #NEWLINE# view = CustomModelView ( Model1 , db . session , column_filters = [ 'test1' , 'bool_field' , 'date_field' , 'datetime_field' , 'time_field' ] ) #NEWLINE# admin . add_view ( view ) #NEWLINE# client = app . test_client ( ) #NEWLINE# rv = client . get ( '/admin/model1/' ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# rv = client . get ( '/admin/model1/new/' ) #NEWLINE# eq_ ( rv . status_code , 200 ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# print ( 'Error on the following locale:' , locale ) #NEWLINE# raise #NEWLINE# #UNINDENT# #UNINDENT# locales = [ 'en' , 'cs' , 'de' , 'es' , 'fa' , 'fr' , 'pt' , 'ru' , 'zh_CN' , 'zh_TW' ] #NEWLINE# for locale in locale : #NEWLINE# #INDENT# test_locale ( locale )