summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/staticfiles_tests')
-rw-r--r--tests/staticfiles_tests/test_finders.py79
1 files changed, 0 insertions, 79 deletions
diff --git a/tests/staticfiles_tests/test_finders.py b/tests/staticfiles_tests/test_finders.py
index 2f1863a1d4..7efe86ab6a 100644
--- a/tests/staticfiles_tests/test_finders.py
+++ b/tests/staticfiles_tests/test_finders.py
@@ -4,15 +4,10 @@ from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, override_settings
-from django.utils.deprecation import RemovedInDjango61Warning
from .cases import StaticFilesTestCase
from .settings import TEST_ROOT
-DEPRECATION_MSG = (
- "Passing the `all` argument to find() is deprecated. Use `find_all` instead."
-)
-
class TestFinders:
"""
@@ -35,47 +30,6 @@ class TestFinders:
dst = [os.path.normcase(d) for d in dst]
self.assertEqual(found, dst)
- def test_find_all_deprecated_param(self):
- src, dst = self.find_all
- with self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx:
- found = self.finder.find(src, all=True)
- found = [os.path.normcase(f) for f in found]
- dst = [os.path.normcase(d) for d in dst]
- self.assertEqual(found, dst)
- self.assertEqual(ctx.filename, __file__)
-
- def test_find_all_conflicting_params(self):
- src, dst = self.find_all
- msg = (
- f"{self.finder.__class__.__qualname__}.find() got multiple values for "
- "argument 'find_all'"
- )
- with (
- self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx,
- self.assertRaisesMessage(TypeError, msg),
- ):
- self.finder.find(src, find_all=True, all=True)
- self.assertEqual(ctx.filename, __file__)
-
- def test_find_all_unexpected_params(self):
- src, dst = self.find_all
- msg = (
- f"{self.finder.__class__.__qualname__}.find() got an unexpected keyword "
- "argument 'wrong'"
- )
- with (
- self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx,
- self.assertRaisesMessage(TypeError, msg),
- ):
- self.finder.find(src, all=True, wrong=1)
- self.assertEqual(ctx.filename, __file__)
-
- with self.assertRaisesMessage(TypeError, msg):
- self.finder.find(src, find_all=True, wrong=1)
-
- with self.assertRaisesMessage(TypeError, msg):
- self.finder.find(src, wrong=1)
-
class TestFileSystemFinder(TestFinders, StaticFilesTestCase):
"""
@@ -167,39 +121,6 @@ class TestMiscFinder(SimpleTestCase):
[os.path.join(TEST_ROOT, "project", "documents")],
)
- def test_searched_locations_deprecated_all(self):
- with self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx:
- finders.find("spam", all=True)
- self.assertEqual(
- finders.searched_locations,
- [os.path.join(TEST_ROOT, "project", "documents")],
- )
- self.assertEqual(ctx.filename, __file__)
-
- def test_searched_locations_conflicting_params(self):
- msg = "find() got multiple values for argument 'find_all'"
- with (
- self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx,
- self.assertRaisesMessage(TypeError, msg),
- ):
- finders.find("spam", find_all=True, all=True)
- self.assertEqual(ctx.filename, __file__)
-
- def test_searched_locations_unexpected_params(self):
- msg = "find() got an unexpected keyword argument 'wrong'"
- with (
- self.assertWarnsMessage(RemovedInDjango61Warning, DEPRECATION_MSG) as ctx,
- self.assertRaisesMessage(TypeError, msg),
- ):
- finders.find("spam", all=True, wrong=1)
- self.assertEqual(ctx.filename, __file__)
-
- with self.assertRaisesMessage(TypeError, msg):
- finders.find("spam", find_all=True, wrong=1)
-
- with self.assertRaisesMessage(TypeError, msg):
- finders.find("spam", wrong=1)
-
@override_settings(MEDIA_ROOT="")
def test_location_empty(self):
msg = (