Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Dec 12, 2024
1 parent 36d1afa commit 06faf87
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions site/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from invenio_cern_sync.users.profile import CERNUserProfileSchema
from invenio_pidstore.models import PersistentIdentifier, PIDStatus
from invenio_rdm_records.cli import create_records_custom_field
from invenio_rdm_records.services.pids import providers
from invenio_records_resources.proxies import current_service_registry
from invenio_users_resources.records.api import UserAggregate
from invenio_vocabularies.config import (
Expand All @@ -38,7 +37,7 @@
CDSCommunitiesPermissionPolicy,
CDSRDMRecordPermissionPolicy,
)
from cds_rdm.schemes import is_cern
from cds_rdm.schemes import is_cds, is_inspire_author


class MockJinjaManifest(JinjaManifest):
Expand Down Expand Up @@ -93,7 +92,9 @@ def app_config(app_config):
)
app_config["VOCABULARIES_NAMES_SCHEMES"] = {
**DEFAULT_VOCABULARIES_NAMES_SCHEMES,
"cern": {"label": "CERN", "validator": is_cern, "datacite": "CERN"},
"cern": {"label": "CERN", "validator": is_cds, "datacite": "CERN"},
"inspire": {"label": "Inspire", "validator": is_inspire_author(),
"datacite": "Inspire"},
}
return app_config

Expand Down Expand Up @@ -141,19 +142,19 @@ def create_app(instance_path):

@pytest.fixture
def running_app(
app,
superuser_identity,
location,
cache,
resource_type_v,
languages_v,
funders_v,
awards_v,
licenses_v,
contributors_role_v,
description_type_v,
relation_type_v,
initialise_custom_fields,
app,
superuser_identity,
location,
cache,
resource_type_v,
languages_v,
funders_v,
awards_v,
licenses_v,
contributors_role_v,
description_type_v,
relation_type_v,
initialise_custom_fields,
):
"""This fixture provides an app with the typically needed db data loaded.
Expand Down Expand Up @@ -870,7 +871,8 @@ def add_pid(db):
"""Fixture to add a row to the pidstore_pid table."""

def _add_pid(
pid_type, pid_value, object_uuid, status=PIDStatus.REGISTERED, object_type="rec"
pid_type, pid_value, object_uuid, status=PIDStatus.REGISTERED,
object_type="rec"
):
pid = PersistentIdentifier.create(
pid_type=pid_type,
Expand Down

0 comments on commit 06faf87

Please sign in to comment.