diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-05-28 19:03:26 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-06-04 08:53:17 +0200 |
| commit | fb9d8f06520f495d0c36236f7534dbe660c7e164 (patch) | |
| tree | b13fc4bc02ff0c090665cb9efe17642442395d6c /tests | |
| parent | 083d285b82832f95b57c64144020cc2ce8895a22 (diff) | |
Fixed #22717 -- Auto-corrected missing ending slash in FileSystemStorage
Thanks David Fischer for the report and Moayad Mardini for the
review.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/file_storage/tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 392cd871c3..da9410d70f 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -96,7 +96,7 @@ class FileStorageTests(unittest.TestCase): shutil.rmtree(self.temp_dir) shutil.rmtree(self.temp_dir2) - def test_emtpy_location(self): + def test_empty_location(self): """ Makes sure an exception is raised if the location is empty """ @@ -239,6 +239,14 @@ class FileStorageTests(unittest.TestCase): self.storage.base_url = None self.assertRaises(ValueError, self.storage.url, 'test.file') + # #22717: missing ending slash in base_url should be auto-corrected + storage = self.storage_class(location=self.temp_dir, + base_url='/no_ending_slash') + self.assertEqual( + storage.url('test.file'), + '%s%s' % (storage.base_url, 'test.file') + ) + def test_listdir(self): """ File storage returns a tuple containing directories and files. |
