summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/models.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-01-16 21:31:58 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-01-16 21:31:58 +0000
commit79138a61065bf0c789d9f3f34c55de2e26fda422 (patch)
tree2926fd2a16f1524f36f13031e7fb130c02b8570b /tests/regressiontests/forms/models.py
parentb120c74032c1131e46e4073db1298cf92c4e34c3 (diff)
Fixed #10041: use a tempdir for files in the forms test. Thanks, Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/models.py')
-rw-r--r--tests/regressiontests/forms/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/regressiontests/forms/models.py b/tests/regressiontests/forms/models.py
index 42498cd4f9..86bfb4b920 100644
--- a/tests/regressiontests/forms/models.py
+++ b/tests/regressiontests/forms/models.py
@@ -1,10 +1,15 @@
# -*- coding: utf-8 -*-
import datetime
+import tempfile
from django.db import models
# Can't import as "forms" due to implementation details in the test suite (the
# current file is called "forms" and is already imported).
from django import forms as django_forms
+from django.core.files.storage import FileSystemStorage
+
+temp_storage_location = tempfile.mkdtemp()
+temp_storage = FileSystemStorage(location=temp_storage_location)
class BoundaryModel(models.Model):
positive_integer = models.PositiveIntegerField(null=True, blank=True)
@@ -19,7 +24,7 @@ class ChoiceModel(models.Model):
name = models.CharField(max_length=10)
class FileModel(models.Model):
- file = models.FileField(upload_to='/')
+ file = models.FileField(storage=temp_storage, upload_to='tests')
class FileForm(django_forms.Form):
file1 = django_forms.FileField()