aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/tests/files.py
diff options
context:
space:
mode:
authorTom Christie2012-08-24 22:11:00 +0100
committerTom Christie2012-08-24 22:11:00 +0100
commitaed26b218ea39110489e85abc6f412399a1774a1 (patch)
tree0b461ba4f7f5266056b6463e9b80214e5e273502 /djangorestframework/tests/files.py
parent87b363f7bc5f73d850df123a61895d65ec0b05e7 (diff)
downloaddjango-rest-framework-aed26b218ea39110489e85abc6f412399a1774a1.tar.bz2
Drop out resources & mixins
Diffstat (limited to 'djangorestframework/tests/files.py')
-rw-r--r--djangorestframework/tests/files.py51
1 files changed, 25 insertions, 26 deletions
diff --git a/djangorestframework/tests/files.py b/djangorestframework/tests/files.py
index bbdff70b..90a613b9 100644
--- a/djangorestframework/tests/files.py
+++ b/djangorestframework/tests/files.py
@@ -1,35 +1,34 @@
-from django.test import TestCase
-from django import forms
+# from django.test import TestCase
+# from django import forms
-from djangorestframework.compat import RequestFactory
-from djangorestframework.views import View
-from djangorestframework.resources import FormResource
-from djangorestframework.response import Response
+# from djangorestframework.compat import RequestFactory
+# from djangorestframework.views import View
+# from djangorestframework.response import Response
-import StringIO
+# import StringIO
-class UploadFilesTests(TestCase):
- """Check uploading of files"""
- def setUp(self):
- self.factory = RequestFactory()
- def test_upload_file(self):
+# class UploadFilesTests(TestCase):
+# """Check uploading of files"""
+# def setUp(self):
+# self.factory = RequestFactory()
- class FileForm(forms.Form):
- file = forms.FileField()
+# def test_upload_file(self):
- class MockView(View):
- permissions = ()
- form = FileForm
+# class FileForm(forms.Form):
+# file = forms.FileField()
- def post(self, request, *args, **kwargs):
- return Response({'FILE_NAME': self.CONTENT['file'].name,
- 'FILE_CONTENT': self.CONTENT['file'].read()})
+# class MockView(View):
+# permissions = ()
+# form = FileForm
- file = StringIO.StringIO('stuff')
- file.name = 'stuff.txt'
- request = self.factory.post('/', {'file': file})
- view = MockView.as_view()
- response = view(request)
- self.assertEquals(response.raw_content, {"FILE_CONTENT": "stuff", "FILE_NAME": "stuff.txt"})
+# def post(self, request, *args, **kwargs):
+# return Response({'FILE_NAME': self.CONTENT['file'].name,
+# 'FILE_CONTENT': self.CONTENT['file'].read()})
+# file = StringIO.StringIO('stuff')
+# file.name = 'stuff.txt'
+# request = self.factory.post('/', {'file': file})
+# view = MockView.as_view()
+# response = view(request)
+# self.assertEquals(response.raw_content, {"FILE_CONTENT": "stuff", "FILE_NAME": "stuff.txt"})