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
73e433ed
Commit
73e433ed
authored
Apr 23, 2015
by
kazmiruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes tests for renamed SortedDict
parent
be66e15c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
tests/test_fields.py
+2
-6
tests/test_serializer.py
+1
-1
No files found.
tests/test_fields.py
View file @
73e433ed
...
@@ -11,13 +11,9 @@ from django.core import validators
...
@@ -11,13 +11,9 @@ from django.core import validators
from
django.db
import
models
from
django.db
import
models
from
django.test
import
TestCase
from
django.test
import
TestCase
from
rest_framework
import
serializers
from
rest_framework
import
serializers
from
rest_framework.compat
import
SortedDict
from
tests.models
import
RESTFrameworkModel
from
tests.models
import
RESTFrameworkModel
try
:
from
collections
import
OrderedDict
except
ImportError
:
from
django.utils.datastructures
import
SortedDict
as
OrderedDict
class
TimestampedModel
(
models
.
Model
):
class
TimestampedModel
(
models
.
Model
):
added
=
models
.
DateTimeField
(
auto_now_add
=
True
)
added
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
@@ -99,7 +95,7 @@ class BasicFieldTests(TestCase):
...
@@ -99,7 +95,7 @@ class BasicFieldTests(TestCase):
Field should preserve dictionary ordering, if it exists.
Field should preserve dictionary ordering, if it exists.
See: https://github.com/tomchristie/django-rest-framework/issues/832
See: https://github.com/tomchristie/django-rest-framework/issues/832
"""
"""
ret
=
Order
edDict
()
ret
=
Sort
edDict
()
ret
[
'c'
]
=
1
ret
[
'c'
]
=
1
ret
[
'b'
]
=
1
ret
[
'b'
]
=
1
ret
[
'a'
]
=
1
ret
[
'a'
]
=
1
...
...
tests/test_serializer.py
View file @
73e433ed
...
@@ -1312,7 +1312,7 @@ class SerializerPickleTests(TestCase):
...
@@ -1312,7 +1312,7 @@ class SerializerPickleTests(TestCase):
Regression test for #645.
Regression test for #645.
"""
"""
data
=
serializers
.
DictWithMetadata
({
1
:
1
})
data
=
serializers
.
DictWithMetadata
({
1
:
1
})
self
.
assertEqual
(
data
.
__getstate__
(),
serializers
.
Order
edDict
({
1
:
1
}))
self
.
assertEqual
(
data
.
__getstate__
(),
serializers
.
Sort
edDict
({
1
:
1
}))
def
test_serializer_data_is_pickleable
(
self
):
def
test_serializer_data_is_pickleable
(
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