From 5366aa96fef0ce55fc425cf273c7debe74d99305 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Tue, 23 Feb 2010 22:39:22 +0000 Subject: Fixed #10258: handle duplicate file names better. Instead of just continually appending "_" to duplicate file names, Django's default storage now appends `_1`, `_2`, `_3`, etc. Thanks to ianschenck and Thilo. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12552 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/file_storage/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/regressiontests') diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py index 81ea48950c..b1e31d1811 100644 --- a/tests/regressiontests/file_storage/tests.py +++ b/tests/regressiontests/file_storage/tests.py @@ -126,9 +126,9 @@ class FileSaveRaceConditionTest(TestCase): name = self.save_file('conflict') self.thread.join() self.assert_(self.storage.exists('conflict')) - self.assert_(self.storage.exists('conflict_')) + self.assert_(self.storage.exists('conflict_1')) self.storage.delete('conflict') - self.storage.delete('conflict_') + self.storage.delete('conflict_1') class FileStoragePermissions(TestCase): def setUp(self): @@ -167,7 +167,7 @@ class FileStoragePathParsing(TestCase): self.failIf(os.path.exists(os.path.join(self.storage_dir, 'dotted_.path'))) self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test'))) - self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test_'))) + self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/test_1'))) def test_first_character_dot(self): """ @@ -183,7 +183,7 @@ class FileStoragePathParsing(TestCase): if sys.version_info < (2, 6): self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/_.test'))) else: - self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test_'))) + self.assert_(os.path.exists(os.path.join(self.storage_dir, 'dotted.path/.test_1'))) if Image is not None: class DimensionClosingBug(TestCase): -- cgit v1.3