Fix all tests

This commit is contained in:
amercader 2022-08-24 16:24:14 +02:00
parent 322a92bcec
commit b4a9eba67a
3 changed files with 12 additions and 5 deletions

View File

@ -17,7 +17,7 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: [master, 2.9, 2.9-py2, 2.8, 2.7]
ckan-version: [2.9, 2.9-py2, 2.8, 2.7]
fail-fast: false
name: CKAN ${{ matrix.ckan-version }}
@ -96,7 +96,7 @@ jobs:
psql --host=postgres --username=postgres -d ckan_test --command="ALTER ROLE ckan_default WITH superuser;"
psql --host=postgres --username=postgres -d ckan_test --command="CREATE EXTENSION postgis;"
- name: Run tests
run: pytest --ckan-ini=test-postgis.ini --cov=ckanext.spatial --cov-report=xml --cov-append --disable-warnings ckanext/spatial/tests
run: pytest --ckan-ini=test-postgis.ini --cov=ckanext.spatial --cov-report=xml --cov-append --disable-warnings ckanext/spatial/tests/postgis
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1

View File

@ -3,6 +3,7 @@ import logging
from ckan.lib.base import abort
from ckan.controllers.api import ApiController as BaseApiController
from ckan.model import Session
from ckantoolkit import response
from ckanext.harvest.model import HarvestObject, HarvestObjectExtra
from ckanext.spatial import util

View File

@ -57,7 +57,8 @@ def spatial_setup():
pytestmark = pytest.mark.skipif(
use_postgis is False, reason="PostGIS is no longer used by default")
use_postgis is False, reason="PostGIS is no longer used by default"
)
@pytest.mark.usefixtures(
@ -451,7 +452,7 @@ class TestSpatialExtra(SpatialTestBase):
assert "Error" in res, res
assert "Spatial" in res
assert "Error creating geometry" in res
assert "Wrong GeoJSON object" in res
extents = {
@ -463,7 +464,12 @@ extents = {
@pytest.mark.usefixtures(
"clean_postgis", "clean_db", "clean_index", "harvest_setup", "spatial_setup"
"with_plugins",
"clean_postgis",
"clean_db",
"clean_index",
"harvest_setup",
"spatial_setup",
)
class TestSearchActionPostgis(SpatialTestBase):
def test_spatial_query(self):