Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
73aceb5d
Commit
73aceb5d
authored
Jan 11, 2016
by
Ehtesham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MA-1862] updating api tests
parent
e9622f0d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
lms/djangoapps/discussion_api/tests/test_api.py
+0
-0
lms/djangoapps/discussion_api/tests/utils.py
+17
-2
No files found.
lms/djangoapps/discussion_api/tests/test_api.py
View file @
73aceb5d
This diff is collapsed.
Click to expand it.
lms/djangoapps/discussion_api/tests/utils.py
View file @
73aceb5d
...
...
@@ -71,7 +71,7 @@ class CommentsServiceMockMixin(object):
status
=
200
)
def
register_get_threads_search_response
(
self
,
threads
,
rewrite
):
def
register_get_threads_search_response
(
self
,
threads
,
rewrite
,
num_pages
=
1
):
"""Register a mock response for GET on the CS thread search endpoint"""
httpretty
.
register_uri
(
httpretty
.
GET
,
...
...
@@ -79,7 +79,7 @@ class CommentsServiceMockMixin(object):
body
=
json
.
dumps
({
"collection"
:
threads
,
"page"
:
1
,
"num_pages"
:
1
,
"num_pages"
:
num_pages
,
"corrected_text"
:
rewrite
,
}),
status
=
200
...
...
@@ -371,3 +371,18 @@ def make_minimal_cs_comment(overrides=None):
}
ret
.
update
(
overrides
or
{})
return
ret
def
make_paginated_api_response
(
results
,
count
,
num_pages
,
next
,
previous
):
"""
Generates the response dictionary of paginated APIs with passed data
"""
return
{
"pagination"
:
{
"next"
:
next
,
"previous"
:
previous
,
"count"
:
count
,
"num_pages"
:
num_pages
,
},
"results"
:
results
}
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