Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Test using model objects for dotted source default #5880

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant