Ticket #10041: 10041.diff
File 10041.diff, 1.1 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/forms/models.py
1 1 # -*- coding: utf-8 -*- 2 2 import datetime 3 import tempfile 3 4 4 5 from django.db import models 5 6 # Can't import as "forms" due to implementation details in the test suite (the 6 7 # current file is called "forms" and is already imported). 7 8 from django import forms as django_forms 9 from django.core.files.storage import FileSystemStorage 8 10 11 temp_storage_location = tempfile.mkdtemp() 12 temp_storage = FileSystemStorage(location=temp_storage_location) 13 9 14 class BoundaryModel(models.Model): 10 15 positive_integer = models.PositiveIntegerField(null=True, blank=True) 11 16 … … 19 24 name = models.CharField(max_length=10) 20 25 21 26 class FileModel(models.Model): 22 file = models.FileField( upload_to='/')27 file = models.FileField(storage=temp_storage, upload_to='tests') 23 28 24 29 class FileForm(django_forms.Form): 25 30 file1 = django_forms.FileField()