mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #34547 -- Adjusted deprecation warning stacklevel in DatabaseOperations.field_cast_sql().
This commit is contained in:
parent
c042fe3a74
commit
a69f895d7d
@ -228,6 +228,7 @@ class BaseDatabaseOperations:
|
|||||||
"DatabaseOperations.lookup_cast() instead."
|
"DatabaseOperations.lookup_cast() instead."
|
||||||
),
|
),
|
||||||
RemovedInDjango60Warning,
|
RemovedInDjango60Warning,
|
||||||
|
stacklevel=2,
|
||||||
)
|
)
|
||||||
return "%s"
|
return "%s"
|
||||||
|
|
||||||
|
@ -239,8 +239,9 @@ class DeprecationTests(TestCase):
|
|||||||
"DatabaseOperations.field_cast_sql() is deprecated use "
|
"DatabaseOperations.field_cast_sql() is deprecated use "
|
||||||
"DatabaseOperations.lookup_cast() instead."
|
"DatabaseOperations.lookup_cast() instead."
|
||||||
)
|
)
|
||||||
with self.assertRaisesMessage(RemovedInDjango60Warning, msg):
|
with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
|
||||||
base_ops.field_cast_sql("integer", "IntegerField")
|
base_ops.field_cast_sql("integer", "IntegerField")
|
||||||
|
self.assertEqual(ctx.filename, __file__)
|
||||||
|
|
||||||
def test_field_cast_sql_usage_warning(self):
|
def test_field_cast_sql_usage_warning(self):
|
||||||
compiler = Author.objects.all().query.get_compiler(connection.alias)
|
compiler = Author.objects.all().query.get_compiler(connection.alias)
|
||||||
|
Loading…
Reference in New Issue
Block a user