From: Harmon Date: Fri, 29 Jan 2021 02:10:06 +0000 (-0600) Subject: Replace API.destroy_status id allowed_param with status_id parameter X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4a4398b2c47d49b87a018d7c08c759785b724f04;p=tweepy.git Replace API.destroy_status id allowed_param with status_id parameter --- diff --git a/tests/test_api.py b/tests/test_api.py index 8856593..b4abb16 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -95,7 +95,7 @@ class TweepyAPITests(TweepyTestCase): self.assertEqual(update.text, tweet_text) # test destroy - deleted = self.api.destroy_status(id=update.id) + deleted = self.api.destroy_status(status_id=update.id) self.assertEqual(deleted.id, update.id) @tape.use_cassette('testupdateanddestroystatus.json') @@ -105,7 +105,7 @@ class TweepyAPITests(TweepyTestCase): self.assertEqual(update.text, tweet_text) # test destroy - deleted = self.api.destroy_status(id=update.id) + deleted = self.api.destroy_status(status_id=update.id) self.assertEqual(deleted.id, update.id) @tape.use_cassette('testupdatestatuswithmedia.yaml', serializer='yaml') diff --git a/tweepy/api.py b/tweepy/api.py index 1e6db31..739bb4c 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -266,16 +266,15 @@ class API: require_auth=True, **kwargs ) - def destroy_status(self, *args, **kwargs): + def destroy_status(self, status_id, *args, **kwargs): """ :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-destroy-id :allowed_param: 'id' """ return bind_api( *args, api=self, - path='/statuses/destroy/{id}.json', + path=f'/statuses/destroy/{status_id}.json', method='POST', payload_type='status', - allowed_param=['id'], require_auth=True, **kwargs )