Skip to content

test_saving_draft#

qvain_draft_request#

Source code in tests/behave/features/qvain/test_saving_draft.py
@pytest.fixture
@when("user saves a draft of unpublished dataset in Qvain")
def qvain_draft_request(mock_qvain_dataset_with_files_request, recwarn):
    yield mock_qvain_dataset_with_files_request(status_code=201, published=False)
    raise NotImplementedError

created_draft#

Source code in tests/behave/features/qvain/test_saving_draft.py
@pytest.fixture
@when("new unpublished dataset is created without persistent identifier")
def created_draft():
    dataset = DatasetFactory(
        persistent_identifier=None,
    )
    yield dataset
    raise NotImplementedError

is_draft_dataset#

Source code in tests/behave/features/qvain/test_saving_draft.py
@then("the dataset exists in draft state")
def is_draft_dataset(created_draft):
    logger.info(__name__)
    assert created_draft.persistent_identifier is None
    assert created_draft.issued is None

test_dataset_draft#

Source code in tests/behave/features/qvain/test_saving_draft.py
@pytest.mark.xfail(raises=NotImplementedError)
@scenario("dataset.feature", "Saving draft of unpublished Dataset")
@pytest.mark.django_db
def test_dataset_draft(qvain_draft_request):
    assert qvain_draft_request.status_code == 201