From 8f5d2c374a150fca063443292cdf2618026bda42 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Fri, 9 Aug 2024 12:45:44 -0400 Subject: [5.1.x] Refs #35326 -- Adjusted deprecation warning stacklevel in FileSystemStorage.OS_OPEN_FLAGS. Backport of 47f18a722624527cc72eef44cfc9d1e07ea4b4e0 from main. --- tests/file_storage/tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index c7ca873521..9b643128d1 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -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. -- cgit v1.3