예제 #1
0
 def test_save_tweet(self):
     status = 9999999999999999999999999
     reimbursement = mixer.blend(Reimbursement, search_vector=None)
     command = Command()
     command.log = MagicMock()
     command.save_tweet(reimbursement, status)
     self.assertEqual(status, reimbursement.tweet.status)
     self.assertEqual(1, command.log.info.call_count)
     self.assertEqual(1, Tweet.objects.count())
예제 #2
0
 def test_save_duplicated_tweet(self):
     status = 9999999999999999999999999
     reimbursement = mixer.blend(Reimbursement)
     tweet = mixer.blend(Tweet, status=status, reimbursement=reimbursement)
     command = Command()
     command.log = MagicMock()
     command.save_tweet(reimbursement, status)
     self.assertEqual(status, reimbursement.tweet.status)
     self.assertEqual(1, command.log.info.call_count)
     self.assertEqual(1, Tweet.objects.count())