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
aa03425c
Commit
aa03425c
authored
Feb 11, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #651 from fernandogrd/master
DictWithMetadata.__getstate__ was never called (Fix for 645)
parents
baacdd82
ea004b5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
rest_framework/serializers.py
+1
-1
rest_framework/tests/serializer.py
+7
-0
No files found.
rest_framework/serializers.py
View file @
aa03425c
...
@@ -33,7 +33,7 @@ class DictWithMetadata(dict):
...
@@ -33,7 +33,7 @@ class DictWithMetadata(dict):
"""
"""
# return an instance of the first dict in MRO that isn't a DictWithMetadata
# return an instance of the first dict in MRO that isn't a DictWithMetadata
for
base
in
self
.
__class__
.
__mro__
:
for
base
in
self
.
__class__
.
__mro__
:
if
not
is
instance
(
base
,
DictWithMetadata
)
and
isinstance
(
base
,
dict
):
if
not
is
subclass
(
base
,
DictWithMetadata
)
and
issubclass
(
base
,
dict
):
return
base
(
self
)
return
base
(
self
)
...
...
rest_framework/tests/serializer.py
View file @
aa03425c
...
@@ -900,6 +900,13 @@ class SerializerPickleTests(TestCase):
...
@@ -900,6 +900,13 @@ class SerializerPickleTests(TestCase):
fields
=
(
'name'
,
'age'
)
fields
=
(
'name'
,
'age'
)
pickle
.
dumps
(
InnerPersonSerializer
(
Person
(
name
=
"Noah"
,
age
=
950
))
.
data
)
pickle
.
dumps
(
InnerPersonSerializer
(
Person
(
name
=
"Noah"
,
age
=
950
))
.
data
)
def
test_getstate_method_should_not_return_none
(
self
):
'''Regression test for
https://github.com/tomchristie/django-rest-framework/issues/645
'''
d
=
serializers
.
DictWithMetadata
({
1
:
1
})
self
.
assertEqual
(
d
.
__getstate__
(),
serializers
.
SortedDict
({
1
:
1
}))
class
DepthTest
(
TestCase
):
class
DepthTest
(
TestCase
):
def
test_implicit_nesting
(
self
):
def
test_implicit_nesting
(
self
):
...
...
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