Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
df188018
Commit
df188018
authored
Dec 30, 2012
by
Andrew Hankinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renaming DRFRequestFactory to RequestFactory
Updated tests to reflect the new name.
parent
b9e48e84
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
rest_framework/tests/decorators.py
+2
-3
rest_framework/tests/generics.py
+3
-3
rest_framework/tests/utils.py
+2
-2
No files found.
rest_framework/tests/decorators.py
View file @
df188018
from
django.test
import
TestCase
from
rest_framework
import
status
from
rest_framework.response
import
Response
# from django.test.client import RequestFactory
from
rest_framework.renderers
import
JSONRenderer
from
rest_framework.parsers
import
JSONParser
from
rest_framework.authentication
import
BasicAuthentication
...
...
@@ -17,13 +16,13 @@ from rest_framework.decorators import (
permission_classes
,
)
from
rest_framework.tests.utils
import
DRF
RequestFactory
from
rest_framework.tests.utils
import
RequestFactory
class
DecoratorTestCase
(
TestCase
):
def
setUp
(
self
):
self
.
factory
=
DRF
RequestFactory
()
self
.
factory
=
RequestFactory
()
def
_finalize_response
(
self
,
request
,
response
,
*
args
,
**
kwargs
):
response
.
request
=
request
...
...
rest_framework/tests/generics.py
View file @
df188018
from
django.test
import
TestCase
from
django.utils
import
simplejson
as
json
from
rest_framework
import
generics
,
serializers
,
status
from
rest_framework.tests.utils
import
DRF
RequestFactory
from
rest_framework.tests.utils
import
RequestFactory
from
rest_framework.tests.models
import
BasicModel
,
Comment
,
SlugBasedModel
factory
=
DRF
RequestFactory
()
factory
=
RequestFactory
()
class
RootView
(
generics
.
ListCreateAPIView
):
...
...
@@ -15,7 +15,7 @@ class RootView(generics.ListCreateAPIView):
model
=
BasicModel
class
InstanceView
(
generics
.
Retrieve
Partial
UpdateDestroyAPIView
):
class
InstanceView
(
generics
.
RetrieveUpdateDestroyAPIView
):
"""
Example description for OPTIONS.
"""
...
...
rest_framework/tests/utils.py
View file @
df188018
...
...
@@ -3,10 +3,10 @@ from django.test.client import MULTIPART_CONTENT
from
urlparse
import
urlparse
class
DRF
RequestFactory
(
RequestFactory
):
class
RequestFactory
(
RequestFactory
):
def
__init__
(
self
,
**
defaults
):
super
(
DRF
RequestFactory
,
self
)
.
__init__
(
**
defaults
)
super
(
RequestFactory
,
self
)
.
__init__
(
**
defaults
)
def
patch
(
self
,
path
,
data
=
{},
content_type
=
MULTIPART_CONTENT
,
**
extra
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment