summaryrefslogtreecommitdiff
path: root/tests/regressiontests/bug639/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/bug639/tests.py')
-rw-r--r--tests/regressiontests/bug639/tests.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/regressiontests/bug639/tests.py b/tests/regressiontests/bug639/tests.py
index f9596d06cb..2726dec897 100644
--- a/tests/regressiontests/bug639/tests.py
+++ b/tests/regressiontests/bug639/tests.py
@@ -9,6 +9,7 @@ import unittest
from regressiontests.bug639.models import Photo
from django.http import QueryDict
from django.utils.datastructures import MultiValueDict
+from django.core.files.uploadedfile import SimpleUploadedFile
class Bug639Test(unittest.TestCase):
@@ -21,12 +22,8 @@ class Bug639Test(unittest.TestCase):
# Fake a request query dict with the file
qd = QueryDict("title=Testing&image=", mutable=True)
- qd["image_file"] = {
- "filename" : "test.jpg",
- "content-type" : "image/jpeg",
- "content" : img
- }
-
+ qd["image_file"] = SimpleUploadedFile('test.jpg', img, 'image/jpeg')
+
manip = Photo.AddManipulator()
manip.do_html2python(qd)
p = manip.save(qd)
@@ -39,4 +36,4 @@ class Bug639Test(unittest.TestCase):
Make sure to delete the "uploaded" file to avoid clogging /tmp.
"""
p = Photo.objects.get()
- os.unlink(p.get_image_filename()) \ No newline at end of file
+ os.unlink(p.get_image_filename())