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
64987667
Commit
64987667
authored
Nov 29, 2016
by
Ryan P Kilby
Committed by
Tom Christie
Nov 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix django deprecation warnings (#4712)
parent
9f4c9691
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
tests/test_model_serializer.py
+2
-2
tests/test_prefetch_related.py
+2
-1
No files found.
tests/test_model_serializer.py
View file @
64987667
...
...
@@ -94,7 +94,7 @@ class Issue3674ParentModel(models.Model):
class
Issue3674ChildModel
(
models
.
Model
):
parent
=
models
.
ForeignKey
(
Issue3674ParentModel
,
related_name
=
'children'
)
parent
=
models
.
ForeignKey
(
Issue3674ParentModel
,
related_name
=
'children'
,
on_delete
=
models
.
CASCADE
)
value
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
64
)
...
...
@@ -1013,7 +1013,7 @@ class Issue3674Test(TestCase):
title
=
models
.
CharField
(
max_length
=
64
)
class
TestChildModel
(
models
.
Model
):
parent
=
models
.
ForeignKey
(
TestParentModel
,
related_name
=
'children'
)
parent
=
models
.
ForeignKey
(
TestParentModel
,
related_name
=
'children'
,
on_delete
=
models
.
CASCADE
)
value
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
64
)
class
TestChildModelSerializer
(
serializers
.
ModelSerializer
):
...
...
tests/test_prefetch_related.py
View file @
64987667
...
...
@@ -2,6 +2,7 @@ from django.contrib.auth.models import Group, User
from
django.test
import
TestCase
from
rest_framework
import
generics
,
serializers
from
rest_framework.compat
import
set_many
from
rest_framework.test
import
APIRequestFactory
factory
=
APIRequestFactory
()
...
...
@@ -22,7 +23,7 @@ class TestPrefetchRelatedUpdates(TestCase):
def
setUp
(
self
):
self
.
user
=
User
.
objects
.
create
(
username
=
'tom'
,
email
=
'tom@example.com'
)
self
.
groups
=
[
Group
.
objects
.
create
(
name
=
'a'
),
Group
.
objects
.
create
(
name
=
'b'
)]
se
lf
.
user
.
groups
=
self
.
groups
se
t_many
(
self
.
user
,
'groups'
,
self
.
groups
)
self
.
user
.
save
()
def
test_prefetch_related_updates
(
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