272 |
272 |
|
273 |
273 |
# same with django templated url
|
274 |
274 |
get_request().datasources_cache = {}
|
275 |
|
|
276 |
|
class JsonUrlPath:
|
277 |
|
def get_substitution_variables(self):
|
278 |
|
return {'json_url': 'file://%s' % json_file_path}
|
279 |
|
|
280 |
275 |
pub.substitutions.feed(JsonUrlPath())
|
281 |
276 |
datasource = {'type': 'json', 'value': '{{ json_url }}'}
|
282 |
277 |
assert data_sources.get_items(datasource) == [
|
... | ... | |
286 |
281 |
|
287 |
282 |
# json specified with a variadic url with an erroneous space
|
288 |
283 |
get_request().datasources_cache = {}
|
289 |
|
|
290 |
|
class JsonUrlPath:
|
291 |
|
def get_substitution_variables(self):
|
292 |
|
return {'json_url': 'file://%s' % json_file_path}
|
293 |
|
|
294 |
284 |
pub.substitutions.feed(JsonUrlPath())
|
295 |
285 |
datasource = {'type': 'json', 'value': ' [json_url]'}
|
296 |
286 |
assert data_sources.get_items(datasource) == [
|
... | ... | |
300 |
290 |
|
301 |
291 |
# same with django templated url
|
302 |
292 |
get_request().datasources_cache = {}
|
303 |
|
|
304 |
|
class JsonUrlPath:
|
305 |
|
def get_substitution_variables(self):
|
306 |
|
return {'json_url': 'file://%s' % json_file_path}
|
307 |
|
|
308 |
293 |
pub.substitutions.feed(JsonUrlPath())
|
309 |
294 |
datasource = {'type': 'json', 'value': ' {{ json_url }}'}
|
310 |
295 |
assert data_sources.get_items(datasource) == [
|
... | ... | |
629 |
614 |
|
630 |
615 |
# same with django templated url
|
631 |
616 |
get_request().datasources_cache = {}
|
632 |
|
|
633 |
|
class GeoJSONUrlPath:
|
634 |
|
def get_substitution_variables(self):
|
635 |
|
return {'geojson_url': 'file://%s' % geojson_file_path}
|
636 |
|
|
637 |
617 |
pub.substitutions.feed(GeoJSONUrlPath())
|
638 |
618 |
datasource = {'type': 'geojson', 'value': '{{ geojson_url }}'}
|
639 |
619 |
assert data_sources.get_items(datasource) == [
|
... | ... | |
653 |
633 |
|
654 |
634 |
# geojson specified with a variadic url with an erroneous space
|
655 |
635 |
get_request().datasources_cache = {}
|
656 |
|
|
657 |
|
class GeoJSONUrlPath:
|
658 |
|
def get_substitution_variables(self):
|
659 |
|
return {'geojson_url': 'file://%s' % geojson_file_path}
|
660 |
|
|
661 |
636 |
pub.substitutions.feed(GeoJSONUrlPath())
|
662 |
637 |
datasource = {'type': 'geojson', 'value': ' [geojson_url]'}
|
663 |
638 |
assert data_sources.get_items(datasource) == [
|
... | ... | |
677 |
652 |
|
678 |
653 |
# same with django templated url
|
679 |
654 |
get_request().datasources_cache = {}
|
680 |
|
|
681 |
|
class GeoJSONUrlPath:
|
682 |
|
def get_substitution_variables(self):
|
683 |
|
return {'geojson_url': 'file://%s' % geojson_file_path}
|
684 |
|
|
685 |
655 |
pub.substitutions.feed(GeoJSONUrlPath())
|
686 |
656 |
datasource = {'type': 'geojson', 'value': ' {{ geojson_url }}'}
|
687 |
657 |
assert data_sources.get_items(datasource) == [
|