def test_tweet_best_posts(self):
old_likes = options.likes_to_tweet
old_magic = options.likes_to_magic
old_debug = options.debug
try:
options.likes_to_tweet = 1
options.likes_to_magic = 1
options.debug = False
add_posts(shake_id=self.shake_a.id, sharedfile_id=self.shared_1.id, sourcefile_id=self.source.id)
self.user_b.add_favorite(self.shared_1)
# this like should trigger a tweet
self.assertEqual(MockTweepy.count, 1)
mf = Magicfile.get("sharedfile_id = %s", self.shared_1.id)
self.assertIsNotNone(mf)
finally:
options.likes_to_tweet = old_likes
options.likes_to_magic = old_magic
options.debug = old_debug
评论列表
文章目录