From a3a074437f76d2af8826187c9bc06614ee98b066 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Mon, 30 Dec 2019 22:45:12 +0100 Subject: [PATCH] Add more testing, pending fix of issue in notifications formset --- tests/plugins/notifications/test_views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/plugins/notifications/test_views.py b/tests/plugins/notifications/test_views.py index dacc6cfd..a5a7b99b 100644 --- a/tests/plugins/notifications/test_views.py +++ b/tests/plugins/notifications/test_views.py @@ -43,8 +43,13 @@ class NotificationSettingsTests(RequireRootArticleMixin, ArticleWebTestUtils, Dj data['form-TOTAL_FORMS'] = 1 data['form-0-email'] = 2 + data['form-0-interval'] = 0 # post the request without any change - response = self.client.post(url, data) + response = self.client.post(url, data, follow=True) + + self.assertEqual(len(response.context.get('messages')), 1) + message = response.context.get('messages')._loaded_messages[0] + self.assertIn(message.message, 'Your notification settings were unchanged') # Ensure we didn't create redundant Settings objects assert self.superuser1.nyt_settings.all().count() == 1 -- 2.45.2