コード例 #1
0
 def test_update_trending_scores(self):
     sub1 = SubmissionFactory()
     for i in range(30):
         VoteFactory(submission=sub1)
     self.assertEqual(0, sub1.random_id)
     self.assertEqual(0.0, sub1.score)
     update_trending_scores()
     sub1 = Submission.objects.get(pk=sub1.pk)
     self.assertNotEqual(0, sub1.random_id)
     self.assertGreater(sub1.score, 0.0)
コード例 #2
0
 def handle(self, *args, **options):
     update_trending_scores()