~netlandish/django-wiki

a3a074437f76d2af8826187c9bc06614ee98b066 — Benjamin Bach 4 years ago 8fa4890
Add more testing, pending fix of issue in notifications formset
1 files changed, 6 insertions(+), 1 deletions(-)

M tests/plugins/notifications/test_views.py
M tests/plugins/notifications/test_views.py => tests/plugins/notifications/test_views.py +6 -1
@@ 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