Skip to content

Commit

Permalink
Test case for Pathlib compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Alla committed Aug 13, 2018
1 parent a51cc1a commit f6de2c1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_django_whitenoise.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import unicode_literals

import unittest

try:
from urllib.parse import urljoin, urlparse
except ImportError:
Expand Down Expand Up @@ -107,6 +109,18 @@ def test_get_nonascii_file(self):
self.assertEqual(response.content, self.static_files.nonascii_content)


@override_settings()
class PathlibTest(SimpleTestCase):

@unittest.skipIf(sys.version_info < (3, 4), "Pathlib was added in Python 3.4")
def test_pathlib_compat(self):
from pathlib import Path
settings.STATIC_ROOT = Path('/tmp')
app = get_wsgi_application()
self.assertNotEqual(app, None)



@override_settings()
class UseFindersTest(SimpleTestCase):

Expand Down

0 comments on commit f6de2c1

Please sign in to comment.