Skip to content

Commit

Permalink
tests: compatibility with newer Records-REST
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Jul 31, 2018
1 parent f991adc commit c456de4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_rest.py
Expand Up @@ -27,6 +27,7 @@
from __future__ import absolute_import, print_function

from invenio_records_rest import InvenioRecordsREST
from invenio_records_rest.views import create_blueprint

from invenio_openaire.config import OPENAIRE_REST_ENDPOINTS

Expand All @@ -36,6 +37,9 @@ def test_records_rest(app, db, es, grants):
app.config['RECORDS_REST_ENDPOINTS'] = OPENAIRE_REST_ENDPOINTS
app.config['RECORDS_REST_DEFAULT_READ_PERMISSION_FACTORY'] = None
InvenioRecordsREST(app)
# invenio-records-rest >= 1.1.0 doesn't automatically register endpoints
if 'invenio_records_rest.frdoi_item' not in app.url_map._rules_by_endpoint:
app.register_blueprint(create_blueprint(OPENAIRE_REST_ENDPOINTS))

with app.test_client() as client:
# Item
Expand Down

0 comments on commit c456de4

Please sign in to comment.