diff --git a/moa/tweet.py b/moa/tweet.py index b156967d0e3bde888eed3cef4399a27c704dd970..ca98762f4298ea06925cfbc49a780e50df3f3ed6 100644 --- a/moa/tweet.py +++ b/moa/tweet.py @@ -16,7 +16,7 @@ from moa.models import CON_XP_ONLYIF, CON_XP_ONLYIF_TAGS, CON_XP_UNLESS, CON_XP_ logger = logging.getLogger('worker') HOUR_CUTOFF = 8 -HANDLE_SUFFIX = '' +HANDLE_SUFFIX = '@twitter.com' class Tweet(Message): diff --git a/tests/test_tweets.py b/tests/test_tweets.py index eb74279a72a52fff17a503e07b9b54b1f555ed7d..30a9b62bd52f83886d24b2ee3b48e69896da2095 100644 --- a/tests/test_tweets.py +++ b/tests/test_tweets.py @@ -51,7 +51,7 @@ class TestTweets(unittest.TestCase): tweet = Tweet(self.settings, status, self.api) - expected_content = 'RT @lorddeath\nTbh I need to find time to email @aaisp and be prepared to do some troubleshooting, as my “@a.1” line drops pretty much daily :( Even @aaisp can\'t force BT OpenReach to give me fully-stable lines :p' + expected_content = 'RT @lorddeath@twitter.com\nTbh I need to find time to email @aaisp@twitter.com and be prepared to do some troubleshooting, as my “@a@twitter.com.1” line drops pretty much daily :( Even @aaisp@twitter.com can\'t force BT OpenReach to give me fully-stable lines :p' self.assertEqual(expected_content, tweet.clean_content) @@ -59,7 +59,7 @@ class TestTweets(unittest.TestCase): status = self.thaw_tweet('mention_replacement_1') tweet = Tweet(self.settings, status, self.api) - expected_content = '#booster2019 was another great time. Lovely city, on-point organization (food, coffee), awesome talks & crowd (including an evolter, @MartinBurnsSCO).' + expected_content = '#booster2019 was another great time. Lovely city, on-point organization (food, coffee), awesome talks & crowd (including an evolter, @MartinBurnsSCO@twitter.com).' self.assertEqual(expected_content, tweet.clean_content) @@ -67,7 +67,7 @@ class TestTweets(unittest.TestCase): status = self.thaw_tweet('rt_with_entity_1') tweet = Tweet(self.settings, status, self.api) - expected_content = '+1 \n---\nRT @lisacrispin\nThanks again to all the wonderful, welcoming people who made @boosterconf amazing. Umbrellas, great food, perfect mix of session types & lengths, great diversity, wide range of topics, so fun. #booster2019 💜\nhttps://twitter.com/lisacrispin/status/1106754071233552384' + expected_content = '+1 \n---\nRT @lisacrispin@twitter.com\nThanks again to all the wonderful, welcoming people who made @boosterconf@twitter.com amazing. Umbrellas, great food, perfect mix of session types & lengths, great diversity, wide range of topics, so fun. #booster2019 💜\nhttps://twitter.com/lisacrispin/status/1106754071233552384' self.assertEqual(expected_content, tweet.clean_content) @@ -80,10 +80,10 @@ class TestTweets(unittest.TestCase): expected_content = """Say no to spec work. https://euronews.com/2019/04/15/fire-underway-at-notre-dame-cathedral-in-paris-firefighters-say Source: https://twitter.com/EPhilippePM/status/1118472220509126661 -cc @nospec +cc @nospec@twitter.com --- -RT @EPhilippePM -Faut-il reconstruire une flèche ? À l’identique ? Adaptée aux techniques et aux enjeux de notre époque ? Un concours international d’architecture portant sur la reconstruction de la flèche de la cathédrale sera organisé. #Not… +RT @EPhilippePM@twitter.com +Faut-il reconstruire une flèche ? À l’identique ? Adaptée aux techniques et aux enjeux de notre époque ? Un concours international d’architecture portant sur la reconstruction de la flèche de la cathéd… https://twitter.com/EPhilippePM/status/1118472220509126661""" self.assertEqual(expected_content, tweet.clean_content)