'When the middleware is disabled, an exception is raised when one
attempts to store a message.'

@modify_settings(INSTALLED_APPS={'remove': 'django.contrib.messages'}, MIDDLEWARE={'remove': 'django.contrib.messages.middleware.MessageMiddleware'})
@override_settings(MESSAGE_LEVEL=constants.DEBUG, TEMPLATES=[{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True}])
def test_middleware_disabled(self):

    data = {'messages': [('Test    message    %d' % x) for x in range(5)]}
    reverse('show_message')
    for level in ('debug', 'info', 'success', 'warning', 'error'):
        add_url = reverse('add_message', args=(level,))
        with self.assertRaises(MessageFailure):
            self.client.post(add_url, data, follow=True)
