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
be72ab76
Commit
be72ab76
authored
Jul 19, 2016
by
wajeeha-khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MA-2139: Mark thread as read on thread and comment creation/update/actions
parent
70929ffb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
lms/djangoapps/discussion_api/tests/test_views.py
+6
-4
No files found.
lms/djangoapps/discussion_api/tests/test_views.py
View file @
be72ab76
...
...
@@ -711,6 +711,7 @@ class ThreadViewSetCreateTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
"username"
:
self
.
user
.
username
,
"created_at"
:
"2015-05-19T00:00:00Z"
,
"updated_at"
:
"2015-05-19T00:00:00Z"
,
"read"
:
True
,
})
self
.
register_post_thread_response
(
cs_thread
)
request_data
=
{
...
...
@@ -741,12 +742,12 @@ class ThreadViewSetCreateTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
"voted"
:
False
,
"vote_count"
:
0
,
"comment_count"
:
1
,
"unread_comment_count"
:
1
,
"unread_comment_count"
:
0
,
"comment_list_url"
:
"http://testserver/api/discussion/v1/comments/?thread_id=test_thread"
,
"endorsed_comment_list_url"
:
None
,
"non_endorsed_comment_list_url"
:
None
,
"editable_fields"
:
[
"abuse_flagged"
,
"following"
,
"raw_body"
,
"read"
,
"title"
,
"topic_id"
,
"type"
,
"voted"
],
"read"
:
Fals
e
,
"read"
:
Tru
e
,
"has_endorsed"
:
False
,
"response_count"
:
0
,
}
...
...
@@ -895,7 +896,7 @@ class ThreadViewSetPartialUpdateTest(DiscussionAPIViewTestMixin, ModuleStoreTest
@ddt.unpack
def
test_closed_thread
(
self
,
field
,
value
):
self
.
register_get_user_response
(
self
.
user
)
self
.
register_thread
({
"closed"
:
True
})
self
.
register_thread
({
"closed"
:
True
,
"read"
:
True
})
self
.
register_flag_response
(
"thread"
,
"test_thread"
)
request_data
=
{
field
:
value
}
response
=
self
.
request_patch
(
request_data
)
...
...
@@ -904,11 +905,12 @@ class ThreadViewSetPartialUpdateTest(DiscussionAPIViewTestMixin, ModuleStoreTest
self
.
assertEqual
(
response_data
,
self
.
expected_response_data
({
"read"
:
True
,
"closed"
:
True
,
"abuse_flagged"
:
value
,
"editable_fields"
:
[
"abuse_flagged"
,
"read"
],
"comment_count"
:
1
,
"unread_comment_count"
:
1
,
"unread_comment_count"
:
0
,
})
)
...
...
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