diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2018-10-29 15:56:04 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-29 14:22:42 -0400 |
| commit | 4f8f1b2f245bba83c64b3d5765332bfcb591f1c9 (patch) | |
| tree | 422747860a8a978c91ec66fb72aa60c464590777 /tests/generic_views/test_dates.py | |
| parent | 7f2b27e95c754e7761a559c9564ff8943753ac32 (diff) | |
Fixed #29903 -- Added error message for invalid WeekArchiveView week_format.
Diffstat (limited to 'tests/generic_views/test_dates.py')
| -rw-r--r-- | tests/generic_views/test_dates.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py index 2daac10b31..8cd2b2a8be 100644 --- a/tests/generic_views/test_dates.py +++ b/tests/generic_views/test_dates.py @@ -528,6 +528,10 @@ class WeekArchiveViewTests(TestDataMixin, TestCase): self.assertEqual(res.status_code, 200) self.assertEqual(res.context['week'], datetime.date(2008, 9, 29)) + def test_unknown_week_format(self): + with self.assertRaisesMessage(ValueError, "Unknown week format '%T'. Choices are: %U, %W"): + self.client.get('/dates/books/2008/week/39/unknown_week_format/') + def test_datetime_week_view(self): BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0)) res = self.client.get('/dates/booksignings/2008/week/13/') |
