summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests/test_management.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-11-07 01:26:22 -0800
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-11-07 10:26:22 +0100
commit77aa74cb70dd85497dbade6bc0f394aa41e88c94 (patch)
treef526b5e63897415e8753c6e38396bba535e3fc75 /tests/staticfiles_tests/test_management.py
parent367634f976ab43db93321bf4eb898449b670e291 (diff)
downloaddjango-77aa74cb70dd85497dbade6bc0f394aa41e88c94.tar.gz
Refs #29983 -- Added support for using pathlib.Path in all settings.
Diffstat (limited to 'tests/staticfiles_tests/test_management.py')
-rw-r--r--tests/staticfiles_tests/test_management.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/test_management.py b/tests/staticfiles_tests/test_management.py
index 7630efbd9b..1236d533d3 100644
--- a/tests/staticfiles_tests/test_management.py
+++ b/tests/staticfiles_tests/test_management.py
@@ -4,6 +4,7 @@ import shutil
import tempfile
import unittest
from io import StringIO
+from pathlib import Path
from unittest import mock
from admin_scripts.tests import AdminScriptTestCase
@@ -102,6 +103,7 @@ class TestFindStatic(TestDefaults, CollectionTestCase):
# FileSystemFinder searched locations
self.assertIn(TEST_SETTINGS['STATICFILES_DIRS'][1][1], searched_locations)
self.assertIn(TEST_SETTINGS['STATICFILES_DIRS'][0], searched_locations)
+ self.assertIn(str(TEST_SETTINGS['STATICFILES_DIRS'][2]), searched_locations)
# DefaultStorageFinder searched locations
self.assertIn(
os.path.join('staticfiles_tests', 'project', 'site_media', 'media'),
@@ -174,6 +176,15 @@ class TestCollection(TestDefaults, CollectionTestCase):
self.assertFileNotFound('test/backup~')
self.assertFileNotFound('test/CVS')
+ def test_pathlib(self):
+ self.assertFileContains('pathlib.txt', 'pathlib')
+
+
+class TestCollectionPathLib(TestCollection):
+ def mkdtemp(self):
+ tmp_dir = super().mkdtemp()
+ return Path(tmp_dir)
+
class TestCollectionVerbosity(CollectionTestCase):
copying_msg = 'Copying '