From c194d0a1190663613d75d992c6f1f2ac71490bc2 Mon Sep 17 00:00:00 2001 From: Rojo Date: Thu, 30 Nov 2023 01:46:05 +0000 Subject: [PATCH] Fix tests --- tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests.py b/tests.py index a521807..7cfa922 100644 --- a/tests.py +++ b/tests.py @@ -49,15 +49,15 @@ def test_discord_notification_sent(self, mock_post, mock_send_discord_notificati os.environ['RELAY_DST_URL'] = 'http://localhost' os.environ['DISCORD_WEBHOOK_URL'] = 'http://discordwebhook' - # Mock a successful response from the relay destination - mock_post.return_value.status_code = 200 + # Mock a successful response for the Discord webhook + mock_post.return_value.status_code = 204 - response = self.client.post('/webhooks/test') + response = self.client.post('/webhooks/test', json={}) self.assertEqual(response.status_code, 200) self.assertEqual(response.json, {'success': True}) # Check if the Discord notification was sent - mock_send_discord_notification.assert_called_once_with("Request successfully relayed to http://localhost/test") + mock_send_discord_notification.assert_called_once() if __name__ == '__main__': unittest.main()