Update from 3.4.0 master

This commit is contained in:
Phil Gyford 2016-04-30 14:27:56 +01:00
parent af6262ef80
commit 6eda734082
9 changed files with 44 additions and 19 deletions

View file

@ -1,7 +1,7 @@
from twython import Twython, TwythonError, TwythonAuthError, TwythonRateLimitError
from .config import (
test_tweet_object, test_tweet_html, unittest
test_tweet_object, test_tweet_html, test_tweet_symbols_object, unittest
)
import responses
@ -324,3 +324,10 @@ class TwythonAPITestCase(unittest.TestCase):
del(tweet['entities'])
tweet_text = self.api.html_for_tweet(tweet)
self.assertEqual(tweet['text'], tweet_text)
def test_html_for_tweet_symbols(self):
tweet_text = self.api.html_for_tweet(test_tweet_symbols_object)
# Should only link symbols listed in entities:
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)