def test_is_stale_data_is_true(workflow_app): head = TestRecordMetadata.create_from_kwargs(index=False, has_pid=False) obj = workflow_object_class.create({}) obj.extra_data['is-update'] = True obj.extra_data['head_uuid'] = head.record_metadata.id obj.extra_data['head_version_id'] = head.record_metadata.version_id - 1 assert is_stale_data(obj, None)
def test_is_stale_data_is_true(workflow_app): head = TestRecordMetadata.create_from_kwargs(index=False, has_pid=False) obj = workflow_object_class.create({}) obj.extra_data['is-update'] = True obj.extra_data['head_uuid'] = head.record_metadata.id obj.extra_data['head_version_id'] = head.record_metadata.version_id - 1 assert is_stale_data(obj, None)
def test_is_stale_data_returns_false_if_is_update_is_falsy(workflow_app): TestRecordMetadata.create_from_kwargs(index=False, has_pid=False) obj = workflow_object_class.create({}) assert is_stale_data(obj, None) is False
def test_is_stale_data_returns_false_if_is_update_is_falsy(workflow_app): TestRecordMetadata.create_from_kwargs(index=False, has_pid=False) obj = workflow_object_class.create({}) assert is_stale_data(obj, None) is False