コード例 #1
0
def minimal_record_model(minimal_record):
    """Minimal record."""
    model = RecordMetadata()
    model.created = datetime.utcnow() - timedelta(days=1)
    model.updated = model.created + timedelta(days=1)
    model.version_id = 0
    return Record(minimal_record, model=model)
コード例 #2
0
ファイル: conftest.py プロジェクト: PixelDragon/zenodo
def minimal_record_model(minimal_record):
    """Minimal record."""
    model = RecordMetadata()
    model.created = datetime.utcnow() - timedelta(days=1)
    model.updated = model.created + timedelta(days=1)
    model.version_id = 0
    return Record(minimal_record, model=model)
コード例 #3
0
ファイル: conftest.py プロジェクト: jbenito3/zenodo
def minimal_record_model(db, minimal_record, sip_metadata_types, recid_pid):
    """Minimal record."""
    model = RecordMetadata(id=str(recid_pid.object_uuid))
    model.created = datetime.utcnow() - timedelta(days=1)
    model.updated = model.created + timedelta(days=1)
    model.version_id = 0
    rec = ZenodoRecord(minimal_record, model=model)

    db.session.commit()

    return rec
コード例 #4
0
ファイル: conftest.py プロジェクト: zenodo/zenodo
def minimal_record_model(db, minimal_record, sip_metadata_types):
    """Minimal record."""
    model = RecordMetadata()
    model.created = datetime.utcnow() - timedelta(days=1)
    model.updated = model.created + timedelta(days=1)
    model.version_id = 0
    rec = ZenodoRecord(minimal_record, model=model)

    PersistentIdentifier.create(
        'recid', '123', status=PIDStatus.REGISTERED, object_type='rec',
        object_uuid=rec.id)
    db.session.commit()
    return rec
コード例 #5
0
ファイル: conftest.py プロジェクト: stain/zenodo
def minimal_record_model(db, minimal_record, sip_metadata_types):
    """Minimal record."""
    model = RecordMetadata()
    model.created = datetime.utcnow() - timedelta(days=1)
    model.updated = model.created + timedelta(days=1)
    model.version_id = 0
    rec = ZenodoRecord(minimal_record, model=model)

    PersistentIdentifier.create(
        'recid', '123', status=PIDStatus.REGISTERED, object_type='rec',
        object_uuid=rec.id)
    db.session.commit()
    return rec