#NEWLINE# def testCreateWmsSourceWithAuthentication( self ) : #NEWLINE# #INDENT# '\n        Enter a username and password for a WMS source and ensure that they\n        are correctly encrypted/decrypted.\n        ' #NEWLINE# path = '/minerva_source_wms' #NEWLINE# name = 'testWMSAuth' #NEWLINE# username = 'admin' #NEWLINE# password = 'admin' #NEWLINE# baseURL = 'http://demo.geonode.org/geoserver/wms' #NEWLINE# params = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'username' : username , #NEWLINE# 'password' : password , #NEWLINE# 'baseURL' : name , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . request ( path = path , method = 'POST' , params = params , user = self . _user ) #NEWLINE# self . assertStatusOk ( response ) #NEWLINE# wmsSource = response . json #NEWLINE# credentials = wmsSource [ 'meta' ] [ 'minerva' ] [ 'wms_params' ] [ 'credentials' ] #NEWLINE# self . assertNotEqual ( credentials , '{}:{}' . format ( username , password ) , 'Credentials were not encrypted!' ) #NEWLINE# from girder.plugins.minerva.utility.minerva_utility import decryptCredentials #NEWLINE# decrypted = decryptCredentials ( bytes ( credentials ) ) #NEWLINE# self . assertEquals ( decrypted , '{}:{}' . format ( username , password ) , 'Credentials could not be correctly decrypted' )