I've updated tests so they won't fail when run locally (there was a mismatch between arguments supplied for one of command scripts in tests and in cli, also pdf generation wouldn't run in test env, because pdf gen expects running webserver; fix renders html internally and saves file to disk for pdf rendering).
-------------------- >> begin captured logging << --------------------
django.request: ERROR: Internal Server Error: /risks/data_extraction/loc/AF/ht/EQ/at/impact/an/4/
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch
return handler(request, *args, **kwargs)
File "/home/travis/build/geosolutions-it/geonode/geonode/contrib/risks/views.py", line 563, in get
features = self.get_features(risk, dimension, dymlist, **feat_kwargs)
File "/home/travis/build/geosolutions-it/geonode/geonode/contrib/risks/views.py", line 236, in get_features
password=s['PASSWORD'])
File "/home/travis/build/geosolutions-it/geonode/geonode/contrib/risks/datasource.py", line 22, in __init__
self.wfs = GeoserverDataSource.WFCLASS(url=url, version='2.0.0', **kwargs)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/owslib/wfs.py", line 50, in WebFeatureService
password=password)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 65, in __new__
username=username, password=password)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 92, in __init__
self._buildMetadata(parse_remote_metadata)
File "/home/travis/virtualenv/python2.7.12/lib/python2.7/site-packages/owslib/feature/wfs200.py", line 104, in _buildMetadata
featuretypeelems=featuretypelistelem.findall(nspath('FeatureType', ns=WFS_NAMESPACE))
AttributeError: 'NoneType' object has no attribute 'findall'
We're running empty geoserver in travis, so get_features call will return empty response, because there's no data in. I think we should either:
make geoserver's mockup for tests,
make static dataset for geoserver to be used during tests,
update command scripts to include layers/sql views generation in geoserver, so it will be fully configured to work with risks app, and include that into tests.
I've updated tests so they won't fail when run locally (there was a mismatch between arguments supplied for one of command scripts in tests and in cli, also pdf generation wouldn't run in test env, because pdf gen expects running webserver; fix renders html internally and saves file to disk for pdf rendering).
I tried to run it on travis, but i get the same error for each test, which uses geoserver (for example, https://s3.amazonaws.com/archive.travis-ci.org/jobs/223267759/log.txt):
We're running empty geoserver in travis, so get_features call will return empty response, because there's no data in. I think we should either: