示例#1
0
 def test_local_content_retraction_gets_sent(self, mock_send):
     user = UserFactory()
     content = ContentFactory(author=user.profile)
     self.assertTrue(content.local)
     mock_send.reset_mock()
     content.delete()
     mock_send.assert_called_once_with(content, content.author_id)
示例#2
0
 def test_local_content_retraction_gets_sent(self, mock_send):
     user = UserFactory()
     content = ContentFactory(author=user.profile)
     self.assertTrue(content.local)
     mock_send.reset_mock()
     content_id = content.id
     content.delete()
     mock_send.assert_called_once_with(send_content_retraction, content, content.author_id)
示例#3
0
 def test_exception_calls_logger(self, mock_logger, mock_send):
     user = UserFactory()
     content = ContentFactory(author=user.profile)
     content.delete()
     self.assertTrue(mock_logger.called)
示例#4
0
 def test_non_local_content_retraction_does_not_get_sent(self, mock_send):
     content = ContentFactory()
     content.delete()
     self.assertTrue(mock_send.called is False)
示例#5
0
 def test_non_local_content_retraction_does_not_get_sent(self, mock_send):
     content = ContentFactory()
     content.delete()
     mock_send.assert_not_called()
示例#6
0
 def test_exception_calls_logger(self, mock_logger, mock_send):
     user = UserFactory()
     content = ContentFactory(author=user.profile)
     content.delete()
     self.assertTrue(mock_logger.called)
示例#7
0
 def test_non_local_content_retraction_does_not_get_sent(self, mock_send):
     content = ContentFactory()
     content.delete()
     self.assertTrue(mock_send.called is False)