From 05d333ba3bb16af024c11966d2072de38fe9f82f Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 26 Jun 2012 11:14:23 +0200 Subject: Fixed #18515 -- Conditionally regenerated filename in FileField validation When a FileField value has been saved, a new validation should not regenerate a new filename when checking the length. Refs #9893. --- tests/regressiontests/model_fields/tests.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'tests/regressiontests/model_fields') diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py index 5d3d42ef2a..a89ffcae32 100644 --- a/tests/regressiontests/model_fields/tests.py +++ b/tests/regressiontests/model_fields/tests.py @@ -365,15 +365,3 @@ class FileFieldTests(unittest.TestCase): field = d._meta.get_field('myfile') field.save_form_data(d, 'else.txt') self.assertEqual(d.myfile, 'else.txt') - - def test_max_length(self): - """ - Test that FileField validates the length of the generated file name - that will be stored in the database. Regression for #9893. - - """ - # upload_to = 'unused', so file names are saved as 'unused/xxxxx'. - # max_length = 100, so names longer than 93 characters are rejected. - Document(myfile=93 * 'x').full_clean() - with self.assertRaises(ValidationError): - Document(myfile=94 * 'x').full_clean() -- cgit v1.3