mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Used assertRaisesMessage() to test Django's error messages.
This commit is contained in:
parent
38988f289f
commit
a51c4de194
69 changed files with 448 additions and 173 deletions
|
@ -79,7 +79,11 @@ class ArchiveIndexViewTests(TestDataMixin, TestCase):
|
|||
self.assertTemplateUsed(res, 'generic_views/book_detail.html')
|
||||
|
||||
def test_archive_view_invalid(self):
|
||||
with self.assertRaises(ImproperlyConfigured):
|
||||
msg = (
|
||||
'BookArchive is missing a QuerySet. Define BookArchive.model, '
|
||||
'BookArchive.queryset, or override BookArchive.get_queryset().'
|
||||
)
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
self.client.get('/dates/books/invalid/')
|
||||
|
||||
def test_archive_view_by_month(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue