

@patch('hc.api.transports.requests.request')
def test_slack(self, mock_post):
    self._setup_data('slack', '123')
    self.return_value.status_code = 200
    self.channel.notify(self.check)
    assert (Notification.objects.count() == 1)
    (args, kwargs) = mock_post.call_args
    json = kwargs['json']
    attachment = json['attachments'][0]
    fields = {f['title']: f['value'] for f in attachment['fields']}
    self.assertEqual(fields['Last Ping'], 'Never')

dataset/ETHPy150Open healthchecks/healthchecks/hc/api/tests/test_notify.py NotifyTestCase.test_slack/VarMisuse@27/49 `mock_post`->`self`