Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Resource respects field renames in field-errors #82

Closed
wants to merge 1 commit into from

Conversation

wojcikstefan
Copy link
Member

@wojcikstefan wojcikstefan commented May 5, 2016

Adds more test coverage to the code. Both cleancat and mongoengine validation errors are renamed.
Fixes #3

@tsx tsx force-pushed the test-rename-fields branch from 201bbc6 to 72bccec Compare October 12, 2017 18:54
@tsx tsx changed the title Unit tests for Resource#rename_fields Resource respects field renames in field-errors Oct 12, 2017
@tsx tsx force-pushed the test-rename-fields branch from 72bccec to a2bbf1b Compare October 12, 2017 18:59
Copy link
Member Author

@wojcikstefan wojcikstefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides minor code quality improvements.

Make sure we can create objects by posting a renamed field consistent
with Resource#rename_fields.
"""
resp = self.app.post('/title_post/', data=json.dumps({ 'title': 'title' }))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for whitespace between { and }.

# E.g. if a -> b, b -> c, then a should never be renamed to c.
fields_to_delete = []
fields_to_update = {}
for k, v in mapping.items():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the ks and vs in this method could be replaced with more accurate names describing what these variables actually hold.

@tsx tsx force-pushed the test-rename-fields branch from a633eb6 to 49d5bf9 Compare October 13, 2017 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Honor renamed fields in validation errors
1 participant