Commit 954b2f48 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #578 from wjt/update_status-positional

update_status: first positional argument should be 'status'
parents 5ebe0c79 6f9220b1
......@@ -87,6 +87,17 @@ class TweepyAPITests(TweepyTestCase):
deleted = self.api.destroy_status(id=update.id)
self.assertEqual(deleted.id, update.id)
@tape.use_cassette('testupdateanddestroystatus.json')
def testupdateanddestroystatuswithoutkwarg(self):
# test update, passing text as a positional argument (#554)
text = tweet_text if use_replay else 'testing %i' % random.randint(0, 1000)
update = self.api.update_status(text)
self.assertEqual(update.text, text)
# test destroy
deleted = self.api.destroy_status(id=update.id)
self.assertEqual(deleted.id, update.id)
@tape.use_cassette('testupdatestatuswithmedia.yaml', serializer='yaml')
def testupdatestatuswithmedia(self):
update = self.api.update_with_media('examples/banner.png', status=tweet_text)
......
......@@ -175,11 +175,12 @@ class API(object):
allowed_param=['id']
)
def update_status(self, media_ids=None, *args, **kwargs):
def update_status(self, *args, **kwargs):
""" :reference: https://dev.twitter.com/rest/reference/post/statuses/update
:allowed_param:'status', 'in_reply_to_status_id', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'
"""
post_data = {}
media_ids = kwargs.pop("media_ids", None)
if media_ids is not None:
post_data["media_ids"] = list_to_csv(media_ids)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment