def setUp(self):
     registry.register(Layer)
     registry.register(Comment)
     registry.register(Profile)
     create_models(type='layer')
     create_layer_data()
     self.user = get_user_model().objects.filter(username='******')[0]
Exemple #2
0
    def setUp(self):
        super(LayersTest, self).setUp()

        create_layer_data()
        self.user = '******'
        self.passwd = 'admin'
        self.anonymous_user = get_anonymous_user()
Exemple #3
0
    def setUp(self):
        super(LayersTest, self).setUp()

        create_layer_data()
        self.user = '******'
        self.passwd = 'admin'
        self.anonymous_user = get_anonymous_user()
Exemple #4
0
    def setUp(self):
        super(SimpleTest, self).setUp()

        registry.register(Layer)
        registry.register(Comment)
        registry.register(get_user_model())
        create_layer_data()
        self.user = get_user_model().objects.filter(username='******')[0]
Exemple #5
0
    def setUp(self):
        super(SimpleTest, self).setUp()

        registry.register(Layer)
        registry.register(Comment)
        registry.register(Profile)
        create_layer_data()
        self.user = get_user_model().objects.filter(username='******')[0]
Exemple #6
0
    def setUp(self):
        super(PermissionsTest, self).setUp()
        if check_ogc_backend(geoserver.BACKEND_PACKAGE):
            settings.OGC_SERVER['default']['GEOFENCE_SECURITY_ENABLED'] = True

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
Exemple #7
0
    def setUp(self):
        super(PermissionsTest, self).setUp()
        if check_ogc_backend(geoserver.BACKEND_PACKAGE):
            settings.OGC_SERVER['default']['GEOFENCE_SECURITY_ENABLED'] = True

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
Exemple #8
0
    def setUp(self):
        super(LayerModerationTestCase, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
        self.u = get_user_model().objects.get(username=self.user)
        self.u.email = '*****@*****.**'
        self.u.is_active = True
        self.u.save()
Exemple #9
0
    def setUp(self):
        super(LayerModerationTestCase, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
        self.u = get_user_model().objects.get(username=self.user)
        self.u.email = '*****@*****.**'
        self.u.is_active = True
        self.u.save()
Exemple #10
0
    def setUp(self):
        super(LayerNotificationsTestCase, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
        self.u = get_user_model().objects.get(username=self.user)
        self.u.email = '*****@*****.**'
        self.u.is_active = True
        self.u.save()
        self.setup_notifications_for(LayersAppConfig.NOTIFICATIONS, self.u)
Exemple #11
0
    def setUp(self):
        super(LayerNotificationsTestCase, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.anonymous_user = get_anonymous_user()
        self.u = get_user_model().objects.get(username=self.user)
        self.u.email = '*****@*****.**'
        self.u.is_active = True
        self.u.save()
        self.setup_notifications_for(LayersAppConfig.NOTIFICATIONS, self.u)
Exemple #12
0
    def setUp(self):
        super().setUp()
        self.user = '******'
        self.passwd = 'admin'
        create_layer_data()
        self.config = Configuration.load()

        self.OGC_DEFAULT_SETTINGS = {
            'default': {
                'BACKEND': 'geonode.geoserver',
                'LOCATION': 'http://localhost:8080/geoserver/',
                'USER': '******',
                'PASSWORD': '******',
                'MAPFISH_PRINT_ENABLED': True,
                'PRINT_NG_ENABLED': True,
                'GEONODE_SECURITY_ENABLED': True,
                'GEOFENCE_SECURITY_ENABLED': True,
                'WMST_ENABLED': False,
                'BACKEND_WRITE_ENABLED': True,
                'WPS_ENABLED': False,
                'DATASTORE': '',
            }
        }

        self.UPLOADER_DEFAULT_SETTINGS = {
            'BACKEND': 'geonode.importer',
            'OPTIONS': {
                'TIME_ENABLED': False,
                'MOSAIC_ENABLED': False
            }
        }

        self.DATABASE_DEFAULT_SETTINGS = {
            'default': {
                'ENGINE': 'django.db.backends.sqlite3',
                'NAME': 'development.db'
            }
        }
Exemple #13
0
    def test_set_attributes_from_geoserver(self):
        """Test attributes syncronization
        """
        layer = Layer.objects.all().first()
        create_layer_data(layer.resourcebase_ptr_id)
        try:
            # set attributes for resource
            for attribute in layer.attribute_set.all():
                attribute.attribute_label = f'{attribute.attribute}_label'
                attribute.description = f'{attribute.attribute}_description'
                attribute.save()

            # tests if everything is synced properly
            for attribute in layer.attribute_set.all():
                self.assertEqual(
                    attribute.attribute_label,
                    f'{attribute.attribute}_label'
                )
                self.assertEqual(
                    attribute.description,
                    f'{attribute.attribute}_description'
                )

            # sync the attributes with GeoServer
            # since on geoserver are empty, we expect that now the layer
            # does not have any attribute
            set_attributes_from_geoserver(layer)

            links = Link.objects.filter(resource=layer.resourcebase_ptr)
            self.assertIsNotNone(links)
            self.assertTrue(len(links) >= 7)

            original_data_links = [ll for ll in links if 'original' == ll.link_type]
            self.assertEqual(len(original_data_links), 0)

        finally:
            # Clean up and completely delete the layers
            layer.delete()
Exemple #14
0
 def setUp(self):
     super(LayerTests, self).setUp()
     self.user = '******'
     self.passwd = 'admin'
     create_layer_data()
Exemple #15
0
 def setUp(self):
     create_models(type="layer")
     create_layer_data()
     self.user = User.objects.filter(username="******")[0]
Exemple #16
0
 def setUp(self):
     self.user = '******'
     self.passwd = 'admin'
     create_models(type='layer')
     create_layer_data()
     self.anonymous_user = get_anonymous_user()
Exemple #17
0
 def setUp(self):
     super(LayerTests, self).setUp()
     self.user = '******'
     self.passwd = 'admin'
     create_layer_data()
     self.config = Configuration.load()
Exemple #18
0
 def setUp(self):
     super(TestCswGlobalDispatch, self).setUp()
     self.request = self.__request_factory_single(123)
     create_layer_data()
     self.user = "******"
     self.passwd = "admin"
Exemple #19
0
 def setUp(self):
     self.user = '******'
     self.passwd = 'admin'
     create_models(type='layer')
     create_layer_data()
Exemple #20
0
 def setUp(self):
     self.user = '******'
     self.passwd = 'admin'
     create_models(type='layer')
     create_layer_data()
Exemple #21
0
 def setUp(self):
     self.user = '******'
     self.passwd = 'admin'
     create_models(type='layer')
     create_layer_data()
     self.anonymous_user = get_anonymous_user()
Exemple #22
0
 def setUp(self):
     self.user = "******"
     self.passwd = "admin"
     create_models(type="layer")
     create_layer_data()
Exemple #23
0
 def setUp(self):
     super(LayerTests, self).setUp()
     self.user = '******'
     self.passwd = 'admin'
     create_layer_data()
Exemple #24
0
 def setUp(self):
     create_models(type='layer')
     create_layer_data()
     self.user = get_user_model().objects.filter(username='******')[0]
Exemple #25
0
 def setUp(self):
     super().setUp()
     self.request = self.__request_factory_single(123)
     create_layer_data()
     self.user = "******"
     self.passwd = "admin"