From 03c581eee3e0b7b7a9b843337774e5d72d7ee960 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Wed, 22 Nov 2017 01:37:56 -0500 Subject: [PATCH] Add request attribute exception test --- tests/test_request.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_request.py b/tests/test_request.py index 6726fa914..cbadb1467 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -263,3 +263,12 @@ class TestWSGIRequestProxy(TestCase): outer_sentinel = object() request.inner_property = outer_sentinel assert request.inner_property is outer_sentinel + + def test_exception(self): + # ensure the exception message is not for the underlying WSGIRequest + wsgi_request = factory.get('/') + request = Request(wsgi_request) + + message = "'Request' object has no attribute 'inner_property'" + with self.assertRaisesMessage(AttributeError, message): + request.inner_property