Refs #32508 -- Raised TypeError instead of using "assert" on unsupported operations for sliced querysets.

This commit is contained in:
Mariusz Felisiak 2021-03-10 09:16:28 +01:00 committed by GitHub
parent 6f5dbe9dbe
commit ba9a2b7544
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 60 additions and 30 deletions

View file

@ -130,7 +130,7 @@ class AdvancedTests(TestCase):
"""
method = DataPoint.objects.all()[:2].update
msg = 'Cannot update a query once a slice has been taken.'
with self.assertRaisesMessage(AssertionError, msg):
with self.assertRaisesMessage(TypeError, msg):
method(another_value='another thing')
def test_update_respects_to_field(self):