From e5c2f4b6d6e81bd60810edb542ab92e38d40ce38 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 03 2019 10:30:30 +0000 Subject: Fix the webhook notifications tests Basically, when we changed year to 2019, the msg-id changed and that lead to different signatures hash. We're now asking the tests to stay on 2018, should make the tests consistent for the years to come! Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_lib_task_services.py b/tests/test_pagure_lib_task_services.py index 77c32f4..6c2b2e4 100644 --- a/tests/test_pagure_lib_task_services.py +++ b/tests/test_pagure_lib_task_services.py @@ -429,10 +429,14 @@ class PagureLibTaskServicesWithWebHooktests(tests.Modeltests): @patch('time.time', MagicMock(return_value=2)) @patch('uuid.uuid4', MagicMock(return_value='not_so_random')) + @patch('datetime.datetime') @patch('requests.post') - def test_webhook_notification_no_webhook(self, post): + def test_webhook_notification_no_webhook(self, post, dt): """ Test the webhook_notification method. """ post.return_value = False + utcnow = MagicMock() + utcnow.year = 2018 + dt.utcnow.return_value = utcnow output = pagure.lib.tasks_services.webhook_notification( topic='topic',