Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
 def test_non_local_content_retraction_does_not_get_sent(self, mock_send):
     content = ContentFactory()
     content.delete()
     mock_send.assert_not_called()
Esempio n. 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)
Esempio n. 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)