def testCreateWmsSourceWithAuthentication(self):
        # Create the source.
        path = '/minerva_source_wms'
        name = 'testWMSAuth'
        username = 'admin'
        password = 'admin'
        baseURL = 'http://demo.geonode.org/geoserver/wms'
        params = {
            'name': name,
            'username': username,
            'password': password,
            'baseURL': baseURL
        }
        response = self.request(path=path, method='POST',
                                params=params, user=self._user)
        self.assertStatusOk(response)
        wmsSource = response.json
        credentials = wmsSource['meta']['minerva']['wms_params']['credentials']
        # Make sure credentials were encrypted.
        self.assertNotEqual(credentials, '{}:{}'.format(username, password),
                            "Credentials were not encrypted!")

        from girder.plugins.minerva.utility.minerva_utility import decryptCredentials
        decrypted = decryptCredentials(bytes(credentials))
        # Make sure credentials were correctly decrypted.
        self.assertEquals(decrypted, '{}:{}'.format(username, password),
                          'Credentials could not be correctly decrypted')
Enter a username and password for a WMS source and ensure that they
dataset/ETHPy150Open Kitware/minerva/plugin_tests/wms_test.py/WmsTestCase.testCreateWmsSourceWithAuthentication