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
f49461c2
Commit
f49461c2
authored
Oct 14, 2015
by
wajeeha-khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10124 from edx/jia/MA-1240
MA-1240 - DiscussionAPI: fixed thread-list order-by RecentActivity
parents
a2bb8ed9
b5c74652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
lms/djangoapps/discussion_api/api.py
+1
-1
lms/djangoapps/discussion_api/tests/test_api.py
+7
-7
lms/djangoapps/discussion_api/tests/test_views.py
+6
-6
No files found.
lms/djangoapps/discussion_api/api.py
View file @
f49461c2
...
...
@@ -291,7 +291,7 @@ def get_thread_list(
if
exclusive_param_count
>
1
:
# pragma: no cover
raise
ValueError
(
"More than one mutually exclusive param passed to get_thread_list"
)
cc_map
=
{
"last_activity_at"
:
"
date
"
,
"comment_count"
:
"comments"
,
"vote_count"
:
"votes"
}
cc_map
=
{
"last_activity_at"
:
"
activity
"
,
"comment_count"
:
"comments"
,
"vote_count"
:
"votes"
}
if
order_by
not
in
cc_map
:
raise
ValidationError
({
"order_by"
:
...
...
lms/djangoapps/discussion_api/tests/test_api.py
View file @
f49461c2
...
...
@@ -552,7 +552,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"1"
],
...
...
@@ -565,7 +565,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"6"
],
"per_page"
:
[
"14"
],
...
...
@@ -776,7 +776,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"10"
],
...
...
@@ -804,7 +804,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"11"
],
...
...
@@ -831,7 +831,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"11"
],
...
...
@@ -840,7 +840,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
})
@ddt.data
(
(
"last_activity_at"
,
"
date
"
),
(
"last_activity_at"
,
"
activity
"
),
(
"comment_count"
,
"comments"
),
(
"vote_count"
,
"votes"
)
)
...
...
@@ -900,7 +900,7 @@ class GetThreadListTest(CommentsServiceMockMixin, UrlResetMixin, SharedModuleSto
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
http_query
],
"page"
:
[
"1"
],
"per_page"
:
[
"11"
],
...
...
lms/djangoapps/discussion_api/tests/test_views.py
View file @
f49461c2
...
...
@@ -235,7 +235,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"10"
],
...
...
@@ -257,7 +257,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"recursive"
:
[
"False"
],
"page"
:
[
"1"
],
...
...
@@ -280,7 +280,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"18"
],
"per_page"
:
[
"4"
],
...
...
@@ -302,7 +302,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"sort_order"
:
[
"desc"
],
"page"
:
[
"1"
],
"per_page"
:
[
"10"
],
...
...
@@ -333,7 +333,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
)
@ddt.data
(
(
"last_activity_at"
,
"
date
"
),
(
"last_activity_at"
,
"
activity
"
),
(
"comment_count"
,
"comments"
),
(
"vote_count"
,
"votes"
)
)
...
...
@@ -381,7 +381,7 @@ class ThreadViewSetListTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assert_last_query_params
({
"user_id"
:
[
unicode
(
self
.
user
.
id
)],
"course_id"
:
[
unicode
(
self
.
course
.
id
)],
"sort_key"
:
[
"
date
"
],
"sort_key"
:
[
"
activity
"
],
"recursive"
:
[
"False"
],
"page"
:
[
"1"
],
"per_page"
:
[
"10"
],
...
...
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