Example #1
0
 def delete_log(self, user, change=Change.ACTION_SUGGESTION_DELETE, is_spam=False):
     """Delete with logging change"""
     if is_spam and self.userdetails:
         report_spam(
             self.userdetails['address'], self.userdetails['agent'], self.target
         )
     Change.objects.create(
         unit=self.unit, action=change, user=user, target=self.target, author=user
     )
     self.delete()
Example #2
0
 def delete_log(self, user, change=Change.ACTION_SUGGESTION_DELETE,
                is_spam=False):
     """Delete with logging change"""
     if is_spam and self.userdetails:
         report_spam(
             self.userdetails['address'],
             self.userdetails['agent'],
             self.target
         )
     for unit in self.related_units:
         Change.objects.create(
             unit=unit,
             action=change,
             user=user,
             target=self.target,
             author=user
         )
     self.delete()
Example #3
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet("false")
     self.assertIsNone(report_spam("1.2.3.4", "Agent", "text"))
Example #4
0
 def test_akismet_submit_spam(self):
     self.mock_akismet("Thanks for making the web a better place.")
     self.assertIsNone(report_spam("1.2.3.4", "Agent", "text"))
Example #5
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet('false')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))
Example #6
0
 def test_akismet_submit_spam(self):
     self.mock_akismet('Thanks for making the web a better place.')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))
Example #7
0
 def report_spam(self):
     report_spam(self.userdetails["address"], self.userdetails["agent"],
                 self.comment)
Example #8
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet('false')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))
Example #9
0
 def test_akismet_submit_spam(self):
     self.mock_akismet('Thanks for making the web a better place.')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))