Example #1
0
 def test_migrate_status(self):
     migrate_spam.migrate_status(migrate_spam.get_no_status_targets())
     self.comment_2.reload()
     self.comment_1.reload()
     self.comment_3.reload()
     nt.assert_equal(self.comment_1.spam_status, Comment.FLAGGED)
     nt.assert_equal(self.comment_2.spam_status, Comment.FLAGGED)
     nt.assert_equal(self.comment_3.spam_status, Comment.UNKNOWN)
Example #2
0
 def test_migrate_latest(self):
     migrate_spam.migrate_status(migrate_spam.get_no_status_targets())
     migrate_spam.migrate_latest(migrate_spam.get_no_latest_targets())
     date = self.generic_report['date']
     self.comment_4.reload()
     self.comment_6.reload()
     nt.assert_almost_equal(self.comment_4.date_last_reported,
                            date,
                            delta=timedelta(microseconds=1000))
     nt.assert_almost_equal(self.comment_6.date_last_reported,
                            date,
                            delta=timedelta(microseconds=1000))
Example #3
0
 def test_migrate_latest(self):
     migrate_spam.migrate_status(migrate_spam.get_no_status_targets())
     migrate_spam.migrate_latest(migrate_spam.get_no_latest_targets())
     date = self.generic_report['date']
     self.comment_4.reload()
     self.comment_6.reload()
     nt.assert_almost_equal(
         self.comment_4.date_last_reported, date,
         delta=timedelta(microseconds=1000)
     )
     nt.assert_almost_equal(
         self.comment_6.date_last_reported, date,
         delta=timedelta(microseconds=1000)
     )
Example #4
0
 def test_get_latest_targets(self):
     migrate_spam.migrate_status(migrate_spam.get_no_status_targets())
     targets = migrate_spam.get_no_latest_targets()
     nt.assert_equal(len(targets), 4)
Example #5
0
 def test_get_status_targets(self):
     targets = migrate_spam.get_no_status_targets()
     nt.assert_equal(len(targets), 3)