diff options
Diffstat (limited to 'tests/generic_views/test_dates.py')
-rw-r--r-- | tests/generic_views/test_dates.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py index 054ec7d223..6a18e090e6 100644 --- a/tests/generic_views/test_dates.py +++ b/tests/generic_views/test_dates.py @@ -695,7 +695,11 @@ class DateDetailViewTests(TestDataMixin, TestCase): self.assertEqual(res.context['exception'], 'Date out of range') def test_invalid_url(self): - with self.assertRaises(AttributeError): + msg = ( + 'Generic detail view BookDetail must be called with either an ' + 'object pk or a slug in the URLconf.' + ) + with self.assertRaisesMessage(AttributeError, msg): self.client.get("/dates/books/2008/oct/01/nopk/") def test_get_object_custom_queryset(self): |