

def test_request_is_none(self):
    msg = 'some message'
    self.request._messages = self.storage
    with self.assertRaises(TypeError):
        messages.add_message(None, messages.DEBUG, msg)
    self.assertEqual([], self.storage.store)

dataset/ETHPy150Open django/django/tests/messages_tests/test_api.py ApiTest.test_request_is_none/original