Rename API.destroy_direct_message to API.delete_direct_message
authorHarmon <Harmon758@gmail.com>
Fri, 28 May 2021 13:14:17 +0000 (08:14 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 28 May 2021 13:14:17 +0000 (08:14 -0500)
Rename DirectMessage.destroy to DirectMessage.delete

cassettes/testsendanddeletedirectmessage.json [moved from cassettes/testsendanddestroydirectmessage.json with 100% similarity]
docs/api.rst
tests/test_api.py
tweepy/api.py
tweepy/models.py

index ec02bb1433351226b1ca9b1a9170ab4e1b9ae866..40b890c3f65716943b95dc06eb057dd7611f3ab3 100644 (file)
     +------------------------------------------+-------------------------------------+
     | .. centered:: |Sending and receiving events|_                                  |
     +------------------------------------------+-------------------------------------+
-    | `DELETE direct_messages/events/destroy`_ | :meth:`API.destroy_direct_message`  |
+    | `DELETE direct_messages/events/destroy`_ | :meth:`API.delete_direct_message`   |
     +------------------------------------------+-------------------------------------+
     | `GET direct_messages/events/list`_       | :meth:`API.get_direct_messages`     |
     +------------------------------------------+-------------------------------------+
@@ -554,7 +554,7 @@ Direct Messages
 Sending and receiving events
 ----------------------------
 
-.. automethod:: API.destroy_direct_message
+.. automethod:: API.delete_direct_message
 
 .. automethod:: API.get_direct_messages
 
index 76c5faf97f3fe189069266c9de6898cff6afdaae..066a2e62cb22f6c19e4e9fad982e1b56a6103740 100644 (file)
@@ -135,8 +135,8 @@ class TweepyAPITests(TweepyTestCase):
     def testgetdirectmessages(self):
         self.api.get_direct_messages()
 
-    @tape.use_cassette('testsendanddestroydirectmessage.json')
-    def testsendanddestroydirectmessage(self):
+    @tape.use_cassette('testsendanddeletedirectmessage.json')
+    def testsendanddeletedirectmessage(self):
         me = self.api.verify_credentials()
 
         # send
@@ -146,7 +146,7 @@ class TweepyAPITests(TweepyTestCase):
         self.assertEqual(int(sent_dm.message_create['target']['recipient_id']), me.id)
 
         # destroy
-        self.api.destroy_direct_message(sent_dm.id)
+        self.api.delete_direct_message(sent_dm.id)
 
     @tape.use_cassette('testcreatedestroyfriendship.yaml', serializer='yaml')
     def testcreatedestroyfriendship(self):
index 377688ef60b4045985e0cb1d19cec230bc80b520..43ea11043e64f158b55e4fdbc110f814f5603854 100644 (file)
@@ -3153,8 +3153,8 @@ class API:
 
     # Sending and receiving events
 
-    def destroy_direct_message(self, id, **kwargs):
-        """destroy_direct_message(id)
+    def delete_direct_message(self, id, **kwargs):
+        """delete_direct_message(id)
 
         Deletes the direct message specified in the required ID parameter. The
         authenticating user must be the recipient of the specified direct
index b9f1f3dfb41cf37ce9bb6b3a4cb3328d28b74cee..3c1fd1030b1c0add48562993923764adc857831e 100644 (file)
@@ -140,8 +140,8 @@ class DirectMessage(Model):
             results.append(cls.parse(api, obj))
         return results
 
-    def destroy(self):
-        return self._api.destroy_direct_message(self.id)
+    def delete(self):
+        return self._api.delete_direct_message(self.id)
 
 
 class Friendship(Model):