diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-16 09:12:56 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-20 21:23:01 +0200 |
| commit | e2be307b3ab6ebf339b3a765fe64967c9602266f (patch) | |
| tree | e6a7a2c3d5c463c9ced7e094781f4066b5a19dba /django | |
| parent | 75d6c4ae6df93c4c4d8621aced3a180afa18a6cb (diff) | |
Refs #31235 -- Made assertQuerysetEqual() not call repr() on a queryset when compared to string values.
Per deprecation timeline.
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/testcases.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index 7d12594177..ebc8b541ac 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -6,7 +6,6 @@ import posixpath import sys import threading import unittest -import warnings from collections import Counter from contextlib import contextmanager from copy import copy, deepcopy @@ -42,7 +41,6 @@ from django.test.utils import ( CaptureQueriesContext, ContextList, compare_xml, modify_settings, override_settings, ) -from django.utils.deprecation import RemovedInDjango41Warning from django.utils.functional import classproperty from django.utils.version import PY310 from django.views.static import serve @@ -1059,23 +1057,6 @@ class TransactionTestCase(SimpleTestCase): def assertQuerysetEqual(self, qs, values, transform=None, ordered=True, msg=None): values = list(values) - # RemovedInDjango41Warning. - if transform is None: - if ( - values and isinstance(values[0], str) and - qs and not isinstance(qs[0], str) - ): - # Transform qs using repr() if the first element of values is a - # string and the first element of qs is not (which would be the - # case if qs is a flattened values_list). - warnings.warn( - "In Django 4.1, repr() will not be called automatically " - "on a queryset when compared to string values. Set an " - "explicit 'transform' to silence this warning.", - category=RemovedInDjango41Warning, - stacklevel=2, - ) - transform = repr items = qs if transform is not None: items = map(transform, items) |
