1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[5.1.x] Refs #35326 -- Adjusted deprecation warning stacklevel in FileSystemStorage.OS_OPEN_FLAGS.

Backport of 47f18a7226 from main.
This commit is contained in:
Simon Charette
2024-08-09 12:45:44 -04:00
committed by Natalia
parent c87007ab60
commit 8f5d2c374a
3 changed files with 7 additions and 1 deletions

View File

@@ -635,10 +635,11 @@ class OverwritingStorageOSOpenFlagsWarningTests(SimpleTestCase):
def test_os_open_flags_deprecation_warning(self):
msg = "Overriding OS_OPEN_FLAGS is deprecated. Use the allow_overwrite "
msg += "parameter instead."
with self.assertWarnsMessage(RemovedInDjango60Warning, msg):
with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
self.storage = self.storage_class(
location=self.temp_dir, base_url="/test_media_url/"
)
self.assertEqual(ctx.filename, __file__)
# RemovedInDjango60Warning: Remove this test class.