Skip to content

Test using model objects for dotted source default #5880

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 16, 2018

Conversation

carltongibson
Copy link
Collaborator

Test using model objects for dotted source default when path components may be null.

Ref #5375, #5727

There are two branches in rest_framework.fields.get_attribute:

if isinstance(instance, collections.Mapping):
instance = instance[attr]
else:
instance = getattr(instance, attr)

Previous tests were only exercising the if branch. This PR adds similar tests covering the else.

@carltongibson carltongibson force-pushed the 38/model-dotted-defaults branch from 532d678 to 5d40e76 Compare March 16, 2018 13:28
@carltongibson carltongibson added this to the 3.8 Release milestone Mar 16, 2018
@carltongibson carltongibson merged commit 247cf09 into encode:master Mar 16, 2018
@carltongibson carltongibson deleted the 38/model-dotted-defaults branch March 16, 2018 13:51
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant