Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-notes-api
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
edx-notes-api
Commits
b7e9bed1
Commit
b7e9bed1
authored
Jan 05, 2015
by
Oleg Marshev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test.
parent
4627cf17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
notesapi/v1/tests/test_views.py
+8
-0
notesapi/v1/views.py
+1
-1
No files found.
notesapi/v1/tests/test_views.py
View file @
b7e9bed1
...
@@ -469,6 +469,14 @@ class AnnotationViewTests(BaseAnnotationViewTests):
...
@@ -469,6 +469,14 @@ class AnnotationViewTests(BaseAnnotationViewTests):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
len
(
response
.
data
),
5
,
"five annotations should be returned in response"
)
self
.
assertEqual
(
len
(
response
.
data
),
5
,
"five annotations should be returned in response"
)
def
test_read_all_no_query_param
(
self
):
"""
Tests list all annotations when course_id query param is not present.
"""
url
=
reverse
(
'api:v1:annotations'
)
response
=
self
.
client
.
get
(
url
,
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
@patch
(
'django.conf.settings.DISABLE_TOKEN_CHECK'
,
True
)
@patch
(
'django.conf.settings.DISABLE_TOKEN_CHECK'
,
True
)
class
AllowAllAnnotationViewTests
(
BaseAnnotationViewTests
):
class
AllowAllAnnotationViewTests
(
BaseAnnotationViewTests
):
...
...
notesapi/v1/views.py
View file @
b7e9bed1
...
@@ -58,7 +58,7 @@ class AnnotationListView(APIView):
...
@@ -58,7 +58,7 @@ class AnnotationListView(APIView):
"""
"""
params
=
self
.
request
.
QUERY_PARAMS
.
dict
()
params
=
self
.
request
.
QUERY_PARAMS
.
dict
()
if
'course_id'
and
'user'
not
in
params
:
if
'course_id'
not
in
params
:
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
try
:
try
:
...
...
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