Remove API.update_profile_background_image
authorHarmon <Harmon758@gmail.com>
Sat, 19 Dec 2020 10:28:30 +0000 (04:28 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 19 Dec 2020 10:28:30 +0000 (04:28 -0600)
Resolves #1466
The POST account/update_profile_background_image endpoint has been deprecated and removed, since background profile images have not been available or visible on Twitter.com since July 2015.
https://twittercommunity.com/t/upcoming-changes-to-the-developer-platform/104603

docs/api.rst
tests/test_api.py
tweepy/api.py

index fe57078134bfcd8f0bce697b59314660f3112624..7ed53c627d6559eada0b21417bdc88d5af8e28ec 100644 (file)
@@ -601,15 +601,6 @@ Account Methods
    :rtype: :class:`User` object
 
 
-.. method:: API.update_profile_background_image(filename)
-
-   Update authenticating user's background image. Valid formats: GIF, JPG, or
-   PNG
-
-   :param filename: local path to image file to upload. Not a remote URL!
-   :rtype: :class:`User` object
-
-
 .. method:: API.update_profile([name], [url], [location], [description])
 
    Sets values that users are able to set under the "Account" tab of their
index d931b53bf21cfaa9017b128090d7381440d4be14..03783f41590f4fd74dedc5c65668da9a6575adfd 100644 (file)
@@ -217,9 +217,6 @@ class TweepyAPITests(TweepyTestCase):
     """
     def testupateprofileimage(self):
         self.api.update_profile_image('examples/profile.png')
-
-    def testupdateprofilebg(self):
-        self.api.update_profile_background_image('examples/bg.png')
     """
 
     @tape.use_cassette('testupdateprofilebannerimage.yaml', serializer='yaml')
index 2ba33f4eff23cd01866b974a6a07105cedd6e763..48fba3c7e4b8e709d9d809bccab6cdb5f43d6611 100644 (file)
@@ -702,21 +702,6 @@ class API(object):
             require_auth=True
         )(self, post_data=post_data, headers=headers)
 
-    def update_profile_background_image(self, filename, **kwargs):
-        """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_background_image
-            :allowed_param: 'tile', 'include_entities', 'skip_status', 'use'
-        """
-        f = kwargs.pop('file', None)
-        headers, post_data = API._pack_image(filename, 800, f=f)
-        return bind_api(
-            api=self,
-            path='/account/update_profile_background_image.json',
-            method='POST',
-            payload_type='user',
-            allowed_param=['tile', 'include_entities', 'skip_status', 'use'],
-            require_auth=True
-        )(post_data=post_data, headers=headers)
-
     def update_profile_banner(self, filename, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner
             :allowed_param: 'width', 'height', 'offset_left', 'offset_right'