#NEWLINE# def test_custom_config_prefix( self ) : #NEWLINE# #INDENT# self . app . config [ 'CUSTOM_DBNAME' ] = 'flask_pymongo_test_db' #NEWLINE# self . app . config [ 'CUSTOM_HOST' ] = 'localhost' #NEWLINE# self . app . config [ 'CUSTOM_PORT' ] = 27017 #NEWLINE# mongo = flask . ext . pymongo . PyMongo ( self . app , 'CUSTOM' ) #NEWLINE# assert ( mongo . db . name == 'flask_pymongo_test_db' ) , ( 'wrong dbname: %s' % mongo . db . name ) #NEWLINE# if ( pymongo . version_tuple [ 0 ] > 2 ) : #NEWLINE# #INDENT# time . sleep ( 0.2 ) #NEWLINE# assert ( ( 'localhost' , 27017 ) == mongo . cx . address ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( self . cx . host == 'localhost' ) #NEWLINE# assert ( mongo . cx . port == 27017 )