Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Ensure udata 3 compatibility #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements/install.pip
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
udata>=2.1.4.dev
udata>=3.0.0.dev
udata-gouvfr>=3.0.0.dev
requests
5 changes: 5 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from udata.core.dataset.factories import DatasetFactory, ResourceFactory

from udata_gouvfr import frontend
from udata_gouvfr.tests import GouvFrSettings
import udata_schema_gouvfr.views as schema_views


Expand All @@ -21,6 +23,7 @@ def render_base_modals(dataset):

@pytest.fixture
def app(app):
frontend.init_app(app)
app.register_blueprint(schema_views.blueprint)
return app

Expand All @@ -34,6 +37,8 @@ def mock_catalog(requests_mock):
@pytest.mark.usefixtures('clean_db')
@pytest.mark.options(SCHEMA_CATALOG_URL='http://example.com/schemas')
class ViewsTest:
settings = GouvFrSettings

def test_resource_card_no_resource(self):
assert '' == render_resource_card(resource=None)

Expand Down
4 changes: 2 additions & 2 deletions udata_schema_gouvfr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from flask import Blueprint, current_app
from udata.app import cache

from udata import theme
from udata.frontend import template_hook
from udata_gouvfr import theme
from udata_gouvfr.frontend import template_hook

import requests

Expand Down