Replace API.destroy_status id allowed_param with status_id parameter
authorHarmon <Harmon758@gmail.com>
Fri, 29 Jan 2021 02:10:06 +0000 (20:10 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 29 Jan 2021 02:12:48 +0000 (20:12 -0600)
tests/test_api.py
tweepy/api.py

index 8856593b855f7cc29512524f31108467d329d863..b4abb16a30b412d00b5e12c6dea9375e0bc79039 100644 (file)
@@ -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')
index 1e6db315fc048b918c284e663248ca789082db74..739bb4c831564ed39b2c1ae975e401ca68024d49 100644 (file)
@@ -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
         )