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

Fix patching model with a specified primary key. #339

Merged
merged 3 commits into from Aug 4, 2014

Conversation

@cheungpat
Copy link
Contributor

cheungpat commented Jul 17, 2014

When a model has more than one primary key and the alternative primary key is specified in create_api, patch was unable to find the row because the primary_key is not passed to query_by_primary_key.

assert len(loads(response.data)['objects']) == 1
response = self.app.get('/api/user/foo')
assert response.status_code == 200
print response.data

This comment has been minimized.

Copy link
@jfinkels

jfinkels Jul 17, 2014

Owner

Remove print statements.

@@ -1208,6 +1208,30 @@ def test_alternate_primary_key(self):
assert response.status_code == 200
assert loads(response.data) == dict(name='Earth')

def test_specified_primary_key(self):
"""Tests that models with more than one primary keys are

This comment has been minimized.

Copy link
@jfinkels

jfinkels Jul 17, 2014

Owner

Should read "...more than one primary key..." and "...via a specificied primary key."

jfinkels added a commit that referenced this pull request Aug 4, 2014
Fix patching model with a specified primary key.
@jfinkels jfinkels merged commit 83402f3 into jfinkels:master Aug 4, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.