Add test for html_for_tweet for a tweet with missing entities

This commit is contained in:
Phil Gyford 2016-04-28 09:12:15 +01:00
parent 8d719f3f72
commit 49fa42fba3

View file

@ -317,3 +317,10 @@ class TwythonAPITestCase(unittest.TestCase):
# Make sure HTML doesn't contain the display OR expanded url
self.assertTrue('http://google.com' not in tweet_text)
self.assertTrue('google.com' 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)