diff options
| author | Daniyal <abbasi.daniyal98@gmail.com> | 2021-03-24 11:15:08 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-07-15 11:43:33 +0200 |
| commit | f479df7f8d03ab767bb5e5d655243191087d6432 (patch) | |
| tree | bf6f248ad7938a0d9f77ea616a59fba2d5a8befb /tests/dates | |
| parent | 08f077888548a951f01b454d0db08d9407f7f0aa (diff) | |
Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.db.models.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'tests/dates')
| -rw-r--r-- | tests/dates/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/dates/tests.py b/tests/dates/tests.py index 82f21a2634..9f12d997e0 100644 --- a/tests/dates/tests.py +++ b/tests/dates/tests.py @@ -98,11 +98,12 @@ class DatesTests(TestCase): def test_dates_fails_when_given_invalid_kind_argument(self): msg = "'kind' must be one of 'year', 'month', 'week', or 'day'." - with self.assertRaisesMessage(AssertionError, msg): + with self.assertRaisesMessage(ValueError, msg): Article.objects.dates("pub_date", "bad_kind") def test_dates_fails_when_given_invalid_order_argument(self): - with self.assertRaisesMessage(AssertionError, "'order' must be either 'ASC' or 'DESC'."): + msg = "'order' must be either 'ASC' or 'DESC'." + with self.assertRaisesMessage(ValueError, msg): Article.objects.dates("pub_date", "year", order="bad order") @override_settings(USE_TZ=False) |
