Skip to content

Commit 8641fdd

Browse files
committed
renamed local_backend.py to default_storage_backend.py
1 parent 93d14b1 commit 8641fdd

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

ajaxuploader/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from ajaxuploader.tests.local_backend import *
1+
from ajaxuploader.tests.default_storage_backend import *

ajaxuploader/tests/local_backend.py renamed to ajaxuploader/tests/default_storage_backend.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class AjaxUploadTest(TestCase):
12-
urls = 'ajaxuploader.urls'
12+
urls = 'ajaxuploader.tests.urls'
1313

1414
def setUp(self):
1515
super(AjaxUploadTest, self).setUp()
@@ -30,11 +30,11 @@ def setUp(self):
3030

3131
def tearDown(self):
3232
# remove created uploads/tests directory
33-
rmtree(os.path.join(settings.MEDIA_ROOT, 'uploads/tests'))
34-
33+
rmtree(os.path.join(settings.MEDIA_ROOT, 'uploads/tests'))
34+
3535
def test_upload_raw_post_local_backend(self):
3636
"""
37-
tests uploading a file to LocalUploadBackend
37+
tests uploading a file to DefaultStorageUploadBackend
3838
"""
3939

4040
# there is a bug in Django 1.3.1 with raw_post_data in the django test client
@@ -43,9 +43,10 @@ def test_upload_raw_post_local_backend(self):
4343

4444
uploaded_file_name = 'tests/foo.png'
4545

46+
file_data = self.test_file_1.read()
4647
# post raw self.test_file_1 data to AjaxFileUploader as Ajax request
47-
response = self.client.post(reverse('ajax-upload')+'?qqfile=%s' % \
48-
uploaded_file_name, self.test_file_1.read(),
48+
response = self.client.post(reverse('ajax-upload-default-storage')+'?qqfile=%s' % \
49+
uploaded_file_name, file_data,
4950
content_type='application/octet-stream',
5051
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
5152

ajaxuploader/tests/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from ajaxuploader.backends.default_storage import DefaultStorageUploadBackend
55

66

7-
default_storage_uploader = AjaxFileUploader(backend=DefaultStorageBackend)
7+
default_storage_uploader = AjaxFileUploader(backend=DefaultStorageUploadBackend)
88

99
urlpatterns = patterns('',
1010
url(r'^upload$', default_storage_uploader, name="ajax-upload-default-storage"),

0 commit comments

Comments
 (0)