Example #1
0
    def test_get_geodata_gebied_stadsdeel(self):
        q = {
            'eigenaar_cat': 'De staat',
            'zoom': 14,
            'bbox': brk.get_bbox_leaflet(),
            'stadsdeel_naam': 'Noord'
        }
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['stadsdeel_naam'] = 'Centrum'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['stadsdeel_naam'] = 'Noord'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
Example #2
0
    def test_get_geodata_with_shape(self):
        q = {
            'eigenaar_cat': 'De staat',
            'zoom': 14,
            'bbox': brk.get_bbox_leaflet(),
            'buurt_naam': 'Stationsplein e.o.',
            'shape': brk.get_selection_shape()
        }
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['buurt_naam'] = 'BG-terrein e.o.'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['buurt_naam'] = 'Stationsplein e.o.'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
Example #3
0
    def test_get_geodata_gebied_buurtcombinatie(self):
        q = {
            'eigenaar_cat': 'De staat',
            'zoom': 14,
            'bbox': brk.get_bbox_leaflet(),
            'buurtcombinatie_naam': 'Grachtengordel-West'
        }
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['buurtcombinatie_naam'] = 'Burgwallen-Oude Zijde'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['buurtcombinatie_naam'] = 'Grachtengordel-West'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
Example #4
0
    def test_get_geodata_nieteigenpercelen(self):
        q = {'eigenaar_cat': 'De staat', 'bbox': brk.get_bbox_leaflet()}

        for zoom in range(8, 14):
            q['zoom'] = zoom
            response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                       **self.header_auth_scope_brk_plus)
            self.assertEqual(response.status_code, 200)
            self.assertGeoJSON(response.json()['niet_eigenpercelen'])
    def test_get_geodata_nieteigenpercelen(self):
        q = {'eigenaar_cat': 'De staat', 'bbox': brk.get_bbox_leaflet()}

        for zoom in range(8, 14):
            q['zoom'] = zoom
            response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                       **self.header_auth_scope_brk_plus)
            self.assertEqual(response.status_code, 200)
            self.assertGeoJSON(response.json()['niet_eigenpercelen'])
    def test_get_geodata_appartement_geen_eigenaar_cat(self):
        q = {'zoom': 14, 'bbox': brk.get_bbox_leaflet(),
             'eigenaar_type': 'Appartementseigenaar'}
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True, appartementen=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, appartementen=True)
 def test_get_geodata_appartementen(self):
     q = {'eigenaar_cat': 'De staat', 'zoom': 12, 'bbox': brk.get_bbox_leaflet()}
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(len(response.json()['appartementen']), 0)
     q['zoom'] = 13
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(len(response.json()['appartementen']), 1)
Example #8
0
    def test_get_geodata_appartement_geen_eigenaar_cat(self):
        q = {
            'zoom': 14,
            'bbox': brk.get_bbox_leaflet(),
            'eigenaar_type': 'Appartementseigenaar'
        }
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True, appartementen=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, appartementen=True)
Example #9
0
 def test_get_geodata_appartementen(self):
     q = {
         'eigenaar_cat': 'De staat',
         'zoom': 12,
         'bbox': brk.get_bbox_leaflet()
     }
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(len(response.json()['appartementen']), 0)
     q['zoom'] = 13
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(len(response.json()['appartementen']), 1)
    def test_get_geodata_gebied_stadsdeel(self):
        q = {'eigenaar_cat': 'De staat', 'zoom': 14, 'bbox': brk.get_bbox_leaflet(), 'stadsdeel_naam': 'Noord'}
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['stadsdeel_naam'] = 'Centrum'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['stadsdeel_naam'] = 'Noord'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
    def test_get_geodata_gebied_buurtcombinatie(self):
        q = {'eigenaar_cat': 'De staat', 'zoom': 14, 'bbox': brk.get_bbox_leaflet(), 'buurtcombinatie_naam': 'Grachtengordel-West'}
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['buurtcombinatie_naam'] = 'Burgwallen-Oude Zijde'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['buurtcombinatie_naam'] = 'Grachtengordel-West'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
    def test_get_geodata_gebied_buurt(self):
        q = {'eigenaar_cat': 'De staat', 'zoom': 14, 'bbox': brk.get_bbox_leaflet(), 'buurt_naam': 'Stationsplein e.o.'}
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)

        q['buurt_naam'] = 'BG-terrein e.o.'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response, zoomed_in=True)

        q['zoom'] = 11
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidMatching(response)

        q['buurt_naam'] = 'Stationsplein e.o.'
        response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                   **self.header_auth_scope_brk_plus)
        self.assertValidEmpty(response)
Example #13
0
 def test_get_geodata_with_bbox(self):
     q = {'eigenaar_cat': 'Amsterdam', 'zoom': 14}
     q['bbox'] = brk.get_bbox_leaflet()
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)
 def test_get_geodata_with_bbox(self):
     q = {'eigenaar_cat': 'Amsterdam', 'zoom': 14}
     q['bbox'] = brk.get_bbox_leaflet()
     response = self.client.get(BRK_GEO_QUERY.format(urlencode(q)),
                                **self.header_auth_scope_brk_plus)
     self.assertEqual(response.status_code, 200)