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
e476dcb8
Commit
e476dcb8
authored
Feb 26, 2013
by
Danilo Bargen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed AttributeError to AssertionError
parent
ec4d79bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
rest_framework/serializers.py
+2
-3
rest_framework/tests/serializer.py
+1
-1
No files found.
rest_framework/serializers.py
View file @
e476dcb8
...
...
@@ -424,9 +424,8 @@ class ModelSerializer(Serializer):
"""
cls
=
self
.
opts
.
model
if
cls
is
None
:
raise
AttributeError
(
"Serializer class '
%
s' is missing 'model' Meta option"
%
self
.
__class__
.
__name__
)
assert
cls
is
not
None
,
\
"Serializer class '
%
s' is missing 'model' Meta option"
%
self
.
__class__
.
__name__
opts
=
get_concrete_model
(
cls
)
.
_meta
pk_field
=
opts
.
pk
# while pk_field.rel:
...
...
rest_framework/tests/serializer.py
View file @
e476dcb8
...
...
@@ -365,7 +365,7 @@ class ValidationTests(TestCase):
"""
try
:
serializer
=
BrokenModelSerializer
()
except
A
ttribute
Error
as
e
:
except
A
ssertion
Error
as
e
:
self
.
assertEquals
(
e
.
args
[
0
],
"Serializer class 'BrokenModelSerializer' is missing 'model' Meta option"
)
except
:
self
.
fail
(
'Wrong exception type thrown.'
)
...
...
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