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

Change content.delete to allow obj=None and objects=[] or objects=None. #387

Merged
merged 2 commits into from
Sep 25, 2017

Conversation

jaroel
Copy link
Member

@jaroel jaroel commented Sep 23, 2017

Fixes #383

@mauritsvanrees mauritsvanrees merged commit 482c272 into master Sep 25, 2017
@mauritsvanrees mauritsvanrees deleted the 383-content-delete branch September 25, 2017 07:32
@@ -732,6 +732,10 @@ def test_delete_multiple(self):
self.assertNotIn('copy_of_about', container)
self.assertNotIn('about', container['events'])

def test_delete_no_objs(self):
# Check that we allow passing in an empty list of objects.
api.content.delete(obj=None, objects=[])
Copy link
Member

Choose a reason for hiding this comment

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

this test is wrong as obj and objects are mutually exclusive parameters:

@mutually_exclusive_parameters('obj', 'objects')

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

The test passes, so apparently it is fine.
I see that the mutually_exclusive_parameters decorator uses _get_supplied_args, which ignores arguments that are None. That seems why it is okay.

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

3 participants