~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to tests/regressiontests/bug639/tests.py

  • Committer: Package Import Robot
  • Author(s): Luke Faraone, Jakub Wilk, Luke Faraone
  • Date: 2013-05-09 15:10:47 UTC
  • mfrom: (6.2.12 experimental)
  • Revision ID: package-import@ubuntu.com-20130509151047-g79qsrewg1yl43h5
Tags: 1.5.1-2
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Luke Faraone ]
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
from django.core.files.uploadedfile import SimpleUploadedFile
13
13
from django.utils import unittest
 
14
from django.utils._os import upath
14
15
 
15
16
from .models import Photo, PhotoForm, temp_storage_dir
16
17
 
23
24
        called.
24
25
        """
25
26
        # Grab an image for testing.
26
 
        filename = os.path.join(os.path.dirname(__file__), "test.jpg")
27
 
        img = open(filename, "rb").read()
 
27
        filename = os.path.join(os.path.dirname(upath(__file__)), "test.jpg")
 
28
        with open(filename, "rb") as fp:
 
29
            img = fp.read()
28
30
 
29
31
        # Fake a POST QueryDict and FILES MultiValueDict.
30
32
        data = {'title': 'Testing'}