Skip to content

conftest#

load_test_json#

Source code in tests/behave/features/conftest.py
def load_test_json(filename):
    with open(test_data_path + filename) as json_file:
        data = json.load(json_file)
    return data

ida_files_json#

Source code in tests/behave/features/conftest.py
@pytest.fixture
def ida_files_json():
    return load_test_json("ida_files.json")

ida_data_catalog#

Source code in tests/behave/features/conftest.py
@pytest.fixture
@given("IDA has its own data-catalog")
def ida_data_catalog() -> DataCatalog:
    return factories.DataCatalogFactory(allowed_pid_types=["URN", "DOI"])

qvain_user#

Source code in tests/behave/features/conftest.py
@pytest.fixture
def qvain_user(faker):
    user, created = get_user_model().objects.get_or_create(
        username="test_user", password=faker.password()
    )
    return user

mock_request#

Source code in tests/behave/features/conftest.py
@pytest.fixture
def mock_request():
    def _mock_request(status_code):
        request = MagicMock()
        request.status_code = status_code
        return request

    return _mock_request