'Tests the OGC Servers Handler class.'

def test_ogc_server_settings(self):

    with override_settings(OGC_SERVER=self.OGC_DEFAULT_SETTINGS, UPLOADER=self.UPLOADER_DEFAULT_SETTINGS):
        OGC_SERVER = self.OGC_DEFAULT_SETTINGS.copy()
        OGC_SERVER.update({'PUBLIC_LOCATION': 'http://localhost:8080/geoserver/'})
        ogc_settings = OGC_Servers_Handler(OGC_SERVER)['default']
        default = OGC_SERVER.get('default')
        self.assertEqual(ogc_settings.server, default)
        self.assertEqual(ogc_settings.BACKEND, default.get('BACKEND'))
        self.assertEqual(ogc_settings.LOCATION, default.get('LOCATION'))
        self.assertEqual(ogc_settings.PUBLIC_LOCATION, default.get('PUBLIC_LOCATION'))
        self.assertEqual(ogc_settings.USER, default.get('USER'))
        self.assertEqual(ogc_settings.PASSWORD, default.get('PASSWORD'))
        self.assertEqual(ogc_settings.DATASTORE, str())
        self.assertEqual(ogc_settings.credentials, ('admin', 'geoserver'))
        self.assertTrue(ogc_settings.MAPFISH_PRINT_ENABLED)
        self.assertTrue(ogc_settings.PRINT_NG_ENABLED)
        self.assertTrue(ogc_settings.GEONODE_SECURITY_ENABLED)
        self.assertFalse(ogc_settings.GEOGIG_ENABLED)
        self.assertFalse(ogc_settings.WMST_ENABLED)
        self.assertTrue(ogc_settings.BACKEND_WRITE_ENABLED)
        self.assertFalse(ogc_settings.WPS_ENABLED)
