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
c4d77667
Commit
c4d77667
authored
Jan 13, 2014
by
Dustin Farris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ImportingModelSerializerTests and add comments.
parent
b1b58762
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
rest_framework/tests/test_serializer_import.py
+19
-0
rest_framework/tests/test_serializer_nested.py
+0
-6
No files found.
rest_framework/tests/test_serializer_import.py
0 → 100644
View file @
c4d77667
from
django.test
import
TestCase
from
rest_framework
import
serializers
from
rest_framework.tests.accounts.serializers
import
AccountSerializer
class
ImportingModelSerializerTests
(
TestCase
):
"""
In some situations like, GH #1225, it is possible, especially in
testing, to import a serializer who's related models have not yet
been resolved by Django. `AccountSerializer` is an example of such
a serializer (imported at the top of this file).
"""
def
test_import_model_serializer
(
self
):
"""
The serializer at the top of this file should have been
imported successfully, and we should be able to instantiate it.
"""
self
.
assertIsInstance
(
AccountSerializer
(),
serializers
.
ModelSerializer
)
rest_framework/tests/test_serializer_nested.py
View file @
c4d77667
...
...
@@ -6,7 +6,6 @@ Doesn't cover model serializers.
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
rest_framework
import
serializers
from
rest_framework.tests.accounts.serializers
import
AccountSerializer
from
.
import
models
...
...
@@ -346,8 +345,3 @@ class NestedModelSerializerUpdateTests(TestCase):
result
=
deserialize
.
object
result
.
save
()
self
.
assertEqual
(
result
.
id
,
john
.
id
)
class
ImportingModelSerializerWithStrForeignKeys
(
TestCase
):
def
test_import_model_serializer
(
self
):
self
.
assertIsInstance
(
AccountSerializer
(),
serializers
.
ModelSerializer
)
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