예제 #1
0
파일: tests.py 프로젝트: atenekom/geonode
    def setUp(self):
        super(SearchApiTests, self).setUp()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        all_public()
        self.norman = get_user_model().objects.get(username="******")
        self.norman.groups.add(Group.objects.get(name='anonymous'))
        self.test_user = get_user_model().objects.get(username='******')
        self.test_user.groups.add(Group.objects.get(name='anonymous'))
        self.bar = GroupProfile.objects.get(slug='bar')
        self.anonymous_user = get_anonymous_user()
        self.profiles_list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'profiles'})
        self.groups_list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'groups'})
예제 #2
0
    def setUp(self):
        super(SearchApiTests, self).setUp()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        all_public()
        self.norman = get_user_model().objects.get(username="******")
        self.norman.groups.add(Group.objects.get(name='anonymous'))
        self.test_user = get_user_model().objects.get(username='******')
        self.test_user.groups.add(Group.objects.get(name='anonymous'))
        self.bar = GroupProfile.objects.get(slug='bar')
        self.anonymous_user = get_anonymous_user()
        self.profiles_list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'profiles'})
        self.groups_list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'groups'})
예제 #3
0
    def setUpClass(cls):
        super().setUpClass()
        create_models(type=cls.get_type, integration=cls.get_integration)
        all_public()
        cls.user_admin = get_user_model().objects.get(username="******")

        if check_ogc_backend(geoserver.BACKEND_PACKAGE):
            cls.dataset_coast_line = create_single_dataset('san_andres_y_providencia_coastline')
예제 #4
0
 def setUp(self):
     super(ThesaurusKeywordResourceTests, self).setUp()
     all_public()
     self.list_url = reverse("api_dispatch_list",
                             kwargs={
                                 "api_name": "api",
                                 "resource_name": "thesaurus/keywords"
                             })
예제 #5
0
 def setUp(self):
     super(MapResourceTests, self).setUp()
     all_public()
     self.user = get_user_model().objects.get(username="******")
     self.list_url = reverse('api_dispatch_list',
                             kwargs={
                                 'api_name': 'api',
                                 'resource_name': 'maps'
                             })
예제 #6
0
    def setUp(self):
        super(UnpublishedObjectTests, self).setUp()

        self.list_url = reverse('api_dispatch_list',
                                kwargs={
                                    'api_name': 'api',
                                    'resource_name': 'layers'
                                })
        all_public()
예제 #7
0
    def setUp(self):
        super(PermissionsApiTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self.list_url = reverse('api_dispatch_list', kwargs={'api_name':'api', 'resource_name':'layers'})
        create_models(type='layer')
        all_public()
        self.perm_spec = {"users": {}, "groups": {}}
예제 #8
0
파일: tests.py 프로젝트: atenekom/geonode
    def setUp(self):
        super(UnpublishedObjectTests, self).setUp()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        all_public()
예제 #9
0
파일: tests.py 프로젝트: jsiochi/geonode
    def setUp(self):
        super(PermissionsApiTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self.list_url = reverse('api_dispatch_list', kwargs={'api_name':'api', 'resource_name':'layers'})
        create_models(type='layer')
        all_public()
        self.perm_spec = {"anonymous":"_none","authenticated":"layer_readwrite","users":[]}
예제 #10
0
    def setUp(self):
        super(SearchApiTests, self).setUp()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        create_models(type='layer')
        all_public()
예제 #11
0
    def setUp(self):
        super(SearchApiTests, self).setUp()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        create_models(type='layer')
        all_public()
예제 #12
0
 def setUp(self):
     super(PermissionsApiTests, self).setUp()
     self.user = '******'
     self.passwd = 'admin'
     self.list_url = reverse('api_dispatch_list',
                             kwargs={
                                 'api_name': 'api',
                                 'resource_name': 'layers'
                             })
     all_public()
     self.perm_spec = {"users": {}, "groups": {}}
예제 #13
0
 def setUp(self):
     super(LayerResourceTests, self).setUp()
     self.user = get_user_model().objects.get(username="******")
     self.list_url = reverse('api_dispatch_list',
                             kwargs={
                                 'api_name': 'api',
                                 'resource_name': 'layers'
                             })
     all_public()
     self.token = get_or_create_token(self.user)
     self.auth_header = 'Bearer {}'.format(self.token)
예제 #14
0
 def setUp(self):
     super(DataTypeResourceTests, self).setUp()
     self.user = get_user_model().objects.get(username="******")
     self.list_url = reverse('api_dispatch_list',
                             kwargs={
                                 'api_name': 'api',
                                 'resource_name': 'datatype'
                             })
     all_public()
     self.token = get_or_create_token(self.user)
     self.auth_header = f'Bearer {self.token}'
예제 #15
0
파일: tests.py 프로젝트: atenekom/geonode
    def setUp(self):
        super(BulkPermissionsTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        self.bulk_perms_url = reverse('bulk_permissions')
        all_public()
        self.perm_spec = {
            "users": {"admin": ["view_resourcebase"]}, "groups": {}}
예제 #16
0
    def setUp(self):
        self.user = '******'
        self.passwd = 'admin'
        create_models(type='layer')
        create_layer_data()
        create_notifications()
        self.anonymous_user = get_anonymous_user()

        self.list_url = reverse('api_dispatch_list',
                                kwargs={
                                    'api_name': 'api',
                                    'resource_name': 'layers'
                                })
        all_public()
예제 #17
0
파일: tests.py 프로젝트: alaw005/geonode
    def setUp(self):
        self.user = '******'
        self.passwd = 'admin'
        create_models(type='layer')
        create_layer_data()
        create_notifications()
        self.anonymous_user = get_anonymous_user()

        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        all_public()
예제 #18
0
파일: tests.py 프로젝트: GeoNode/geonode
    def setUp(self):
        super(OAuthApiTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self._user = get_user_model().objects.get(username=self.user)
        self.token = get_or_create_token(self._user)
        self.auth_header = 'Bearer {}'.format(self.token)
        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        all_public()
        self.perm_spec = {"users": {}, "groups": {}}
예제 #19
0
    def setUp(self):
        super(BulkPermissionsTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        self.bulk_perms_url = reverse('bulk_permissions')
        create_models(type='layer')
        all_public()
        self.perm_spec = {
            "users": {"admin": ["view_resourcebase"]}, "groups": {}}
예제 #20
0
    def setUp(self):
        super(OAuthApiTests, self).setUp()

        self.user = '******'
        self.passwd = 'admin'
        self._user = get_user_model().objects.get(username=self.user)
        self.token = get_or_create_token(self._user)
        self.auth_header = f'Bearer {self.token}'
        self.list_url = reverse('api_dispatch_list',
                                kwargs={
                                    'api_name': 'api',
                                    'resource_name': 'layers'
                                })
        all_public()
        self.perm_spec = {"users": {}, "groups": {}}
예제 #21
0
    def setUp(self):
        super(BulkPermissionsTests, self).setUp()
        if check_ogc_backend(geoserver.BACKEND_PACKAGE):
            settings.OGC_SERVER['default']['GEOFENCE_SECURITY_ENABLED'] = True

        self.user = '******'
        self.passwd = 'admin'
        self.list_url = reverse(
            'api_dispatch_list',
            kwargs={
                'api_name': 'api',
                'resource_name': 'layers'})
        self.bulk_perms_url = reverse('bulk_permissions')
        all_public()
        self.perm_spec = {
            "users": {"admin": ["view_resourcebase"]}, "groups": {}}
예제 #22
0
    def setUp(self):
        super(UnpublishedObjectTests, self).setUp()

        self.list_url = reverse("api_dispatch_list", kwargs={"api_name": "api", "resource_name": "layers"})
        create_models(type="layer")
        all_public()
예제 #23
0
 def setUpClass(cls):
     super().setUpClass()
     create_models(type=cls.get_type, integration=cls.get_integration)
     all_public()