mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #28428 -- Made filepath_to_uri() support pathlib.Path.
This commit is contained in:
committed by
Mariusz Felisiak
parent
4c762588ff
commit
6315a272c5
@@ -1,6 +1,7 @@
|
||||
import datetime
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
@@ -106,6 +107,8 @@ class TestRFC3987IEncodingUtils(unittest.TestCase):
|
||||
def test_filepath_to_uri(self):
|
||||
self.assertIsNone(filepath_to_uri(None))
|
||||
self.assertEqual(filepath_to_uri('upload\\чубака.mp4'), 'upload/%D1%87%D1%83%D0%B1%D0%B0%D0%BA%D0%B0.mp4')
|
||||
self.assertEqual(filepath_to_uri(Path('upload/test.png')), 'upload/test.png')
|
||||
self.assertEqual(filepath_to_uri(Path('upload\\test.png')), 'upload/test.png')
|
||||
|
||||
def test_iri_to_uri(self):
|
||||
cases = [
|
||||
|
||||
Reference in New Issue
Block a user