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)
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
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