Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 3
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet("false")
     self.assertIsNone(report_spam("1.2.3.4", "Agent", "text"))
Exemplo n.º 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"))
Exemplo n.º 5
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet('false')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))
Exemplo n.º 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'))
Exemplo n.º 7
0
 def report_spam(self):
     report_spam(self.userdetails["address"], self.userdetails["agent"],
                 self.comment)
Exemplo n.º 8
0
 def test_akismet_submit_spam_error(self):
     self.mock_akismet('false')
     self.assertIsNone(report_spam('1.2.3.4', 'Agent', 'text'))
Exemplo n.º 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'))