Closed ppanero closed 5 years ago
@slint The changes are missing the tests:
RecordMetadataSchemaJSONV1
in order to check proper RECID_FIELD
value injection.test_marshmallow_load
in test_marshmallow_loader.py
. Since the serializer is not declared the following assertion will never be correct:
assert 'pid' in data_dump.data.get('metadata')
PersistentIdentifier
field. Lastly and for consistency the name of ``test_marshmallow_loader.py
should be changed to test_loader_marshmallow.py
.
Code has been tested manually in my application and works as desired.
I would say, let's postpone until https://github.com/inveniosoftware/cookiecutter-invenio-instance/pull/92 is merged, so that it's tested on the cookiecutter-invenio-instance
as well
@slint the cookiecutter PR has been merged, I am going to test it. Just that I cannot put myself as a reviewer :rofl:
Tested. Also closes https://github.com/inveniosoftware/cookiecutter-invenio-instance/issues/97
Fixes: https://github.com/inveniosoftware/invenio-records-rest/issues/232 Fixes: cookiecutter-invenio-instance#97 In order to use it the loader should be overwritten with:
And add the PID attribute name on the environment / config file:
For the code:
import_string()
)? If not, isjson.py
the best place to be for this function,utils.py
?For the tests:
Small punctualization: In order to follow the naming convention of this repo/other invenio repos, shouldn't the file be named
test_loader_marshmallow
instead oftest_marshmallow_loader
(e.g. check the serializers).