Merge b4750a851a into 975095d8d2
This commit is contained in:
commit
1cab991088
2 changed files with 9 additions and 1 deletions
|
|
@ -324,3 +324,10 @@ class TwythonAPITestCase(unittest.TestCase):
|
||||||
self.assertTrue('<a href="https://twitter.com/search?q=%24AAPL" class="twython-symbol">$AAPL</a>' in tweet_text)
|
self.assertTrue('<a href="https://twitter.com/search?q=%24AAPL" class="twython-symbol">$AAPL</a>' in tweet_text)
|
||||||
self.assertTrue('<a href="https://twitter.com/search?q=%24ANOTHER" class="twython-symbol">$ANOTHER</a>' not in tweet_text)
|
self.assertTrue('<a href="https://twitter.com/search?q=%24ANOTHER" class="twython-symbol">$ANOTHER</a>' not in tweet_text)
|
||||||
|
|
||||||
|
def test_html_for_tweet_no_entities(self):
|
||||||
|
"""Test HTML for tweet returns tweet text if it has no entities"""
|
||||||
|
tweet = test_tweet_object
|
||||||
|
del(tweet['entities'])
|
||||||
|
tweet_text = self.api.html_for_tweet(tweet)
|
||||||
|
self.assertEqual(tweet['text'], tweet_text)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -544,8 +544,9 @@ class Twython(EndpointsMixin, object):
|
||||||
if 'retweeted_status' in tweet:
|
if 'retweeted_status' in tweet:
|
||||||
tweet = tweet['retweeted_status']
|
tweet = tweet['retweeted_status']
|
||||||
|
|
||||||
|
text = tweet['text']
|
||||||
|
|
||||||
if 'entities' in tweet:
|
if 'entities' in tweet:
|
||||||
text = tweet['text']
|
|
||||||
entities = tweet['entities']
|
entities = tweet['entities']
|
||||||
|
|
||||||
# Mentions
|
# Mentions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue