diff --git a/tests/file_storage/tests.py b/tests/file_storage/tests.py index 5f0024b81a..3ebeee22c1 100644 --- a/tests/file_storage/tests.py +++ b/tests/file_storage/tests.py @@ -738,6 +738,14 @@ class OverwritingStorageTests(FileStorageTests): self.assertEqual(stored_name, "test_l.txt") self.assertEqual(len(stored_name), 10) + def test_file_name_truncation_with_dotted_name(self): + name = "test.long.dotted.name.txt" + file = ContentFile(b"content") + stored_name = self.storage.save(name, file, max_length=10) + self.addCleanup(self.storage.delete, stored_name) + self.assertEqual(stored_name, "test.l.txt") + self.assertEqual(len(stored_name), 10) + def test_file_name_truncation_extension_too_long(self): name = "file_name.longext" file = ContentFile(b"content")