예제 #1
0
 def test_handle_send_is_called(self, mock_maker, mock_send):
     send_share(self.share.id)
     mock_send.assert_called_once_with(
         "entity",
         self.share.author.federable,
         [self.content.author.handle],
     )
예제 #2
0
 def test_handle_send_is_called(self, mock_maker, mock_send):
     send_share(self.share.id)
     mock_send.assert_called_once_with(
         "entity",
         self.share.author.federable,
         [self.content.author.handle],
     )
예제 #3
0
 def test_handle_send_is_called(self, mock_maker, mock_send):
     send_share(self.share.id)
     mock_send.assert_called_once_with(
         "entity",
         self.share.author,
         [generate_diaspora_profile_id(self.content.author.handle, self.content.author.guid)],
     )
예제 #4
0
 def test_handle_send_is_called(self, mock_maker, mock_send):
     post = Post()
     mock_maker.return_value = post
     send_share(self.share.id, self.share.activities.first().fid)
     mock_send.assert_called_once_with(
         post,
         self.share.author.federable,
         [self.content.author.get_recipient_for_visibility(self.share.visibility)],
     )
예제 #5
0
 def test_doesnt_send_to_local_share_author(self, mock_maker, mock_send):
     send_share(self.local_share.id)
     mock_send.assert_called_once_with("entity",
                                       self.local_share.author.federable,
                                       [])
예제 #6
0
 def test_content_not_sent_in_debug_mode(self, mock_send):
     send_share(self.share.id)
     self.assertTrue(mock_send.called is False)
예제 #7
0
 def test_warning_is_logged_on_no_entity(self, mock_logger, mock_maker):
     send_share(self.share.id)
     self.assertTrue(mock_logger.called)
예제 #8
0
 def test_only_public_share_calls_make_federable_content(self, mock_maker):
     send_share(self.limited_share.id)
     self.assertTrue(mock_maker.called is False)
     send_share(self.share.id)
     mock_maker.assert_called_once_with(self.share)
예제 #9
0
 def test_content_not_sent_in_debug_mode(self, mock_send):
     send_share(self.share.id)
     mock_send.assert_not_called()
예제 #10
0
 def test_doesnt_send_to_local_share_author(self, mock_maker, mock_send):
     post = Post()
     mock_maker.return_value = post
     send_share(self.local_share.id, self.local_share.activities.first().fid)
     mock_send.assert_called_once_with(post, self.local_share.author.federable, [])
예제 #11
0
 def test_doesnt_send_to_local_share_author(self, mock_maker, mock_send):
     send_share(self.local_share.id)
     mock_send.assert_called_once_with("entity", self.local_share.author.federable, [])
예제 #12
0
 def test_content_not_sent_in_debug_mode(self, mock_send):
     send_share(self.share.id)
     self.assertTrue(mock_send.called is False)
예제 #13
0
 def test_warning_is_logged_on_no_entity(self, mock_logger, mock_maker):
     send_share(self.share.id)
     self.assertTrue(mock_logger.called)
예제 #14
0
 def test_only_public_share_calls_make_federable_content(self, mock_maker):
     send_share(self.limited_share.id)
     self.assertTrue(mock_maker.called is False)
     send_share(self.share.id)
     mock_maker.assert_called_once_with(self.share)