From 9ab9cbe3569c05e80ac1a82f92c382303f4ab567 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Mon, 17 Dec 2018 14:45:20 -0500 Subject: [PATCH] Drop the 'sent-at' header from messages so tests pass reliably This header is the time when the message was sent. If the test runs quickly enough the two time stamps could be equal, which is why this doesn't always fail. fixes #2858 Signed-off-by: Jeremy Cline --- bodhi/tests/server/test_notifications.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bodhi/tests/server/test_notifications.py b/bodhi/tests/server/test_notifications.py index 1f45a775be..4ad68ac37e 100644 --- a/bodhi/tests/server/test_notifications.py +++ b/bodhi/tests/server/test_notifications.py @@ -138,6 +138,9 @@ def test_fedmsg_publish_off(self, mock_init): self.assertIn('messages', session.info) for expected, actual in zip(expected_msgs, session.info['messages']): + # fedora-messages <= 1.1.0 include this in equality checks + del expected._headers['sent-at'] + del actual._headers['sent-at'] self.assertEqual(expected, actual) self.assertEqual(0, mock_init.call_count)