diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-07 20:50:36 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-14 17:50:04 +0100 |
| commit | 396da8b94c62cf955ab401eb40a952b7edba0376 (patch) | |
| tree | ad78e90e36aa104fefa591cddbfb4f831a0f33da /tests | |
| parent | 12ac4916af034221a4e08ce6b5669e53a0223a67 (diff) | |
Refs #30841 -- Made isnull lookup raise ValueError for non-boolean values.
Per deprecation timeline.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lookup/tests.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index 9962d34937..548f470523 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -9,7 +9,6 @@ from django.db.models import Exists, Max, OuterRef from django.db.models.functions import Substr from django.test import TestCase, skipUnlessDBFeature from django.test.utils import isolate_apps -from django.utils.deprecation import RemovedInDjango40Warning from .models import ( Article, Author, Freebie, Game, IsNullWithNoneAsRHS, Player, Season, Tag, @@ -985,15 +984,7 @@ class LookupTests(TestCase): self.assertEqual(authors.get(), newest_author) def test_isnull_non_boolean_value(self): - # These tests will catch ValueError in Django 4.0 when using - # non-boolean values for an isnull lookup becomes forbidden. - # msg = ( - # 'The QuerySet value for an isnull lookup must be True or False.' - # ) - msg = ( - 'Using a non-boolean value for an isnull lookup is deprecated, ' - 'use True or False instead.' - ) + msg = 'The QuerySet value for an isnull lookup must be True or False.' tests = [ Author.objects.filter(alias__isnull=1), Article.objects.filter(author__isnull=1), @@ -1002,5 +993,5 @@ class LookupTests(TestCase): ] for qs in tests: with self.subTest(qs=qs): - with self.assertWarnsMessage(RemovedInDjango40Warning, msg): + with self.assertRaisesMessage(ValueError, msg): qs.exists() |
