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
e492aa23
Commit
e492aa23
authored
Sep 14, 2015
by
wajeeha-khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9737 from edx/jia/MA-1182_feedback
MA-1182 - updated
parents
01eb2dff
bbad9ae7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
lms/djangoapps/discussion_api/tests/test_api.py
+6
-0
lms/djangoapps/discussion_api/tests/test_views.py
+0
-2
lms/djangoapps/discussion_api/views.py
+2
-1
No files found.
lms/djangoapps/discussion_api/tests/test_api.py
View file @
e492aa23
...
...
@@ -2912,6 +2912,12 @@ class RetrieveThreadTest(
self
.
assertEqual
(
get_thread
(
self
.
request
,
self
.
thread_id
),
expected_response_data
)
self
.
assertEqual
(
httpretty
.
last_request
()
.
method
,
"GET"
)
def
test_not_enrolled_in_course
(
self
):
self
.
register_thread
()
self
.
request
.
user
=
UserFactory
.
create
()
with
self
.
assertRaises
(
Http404
):
get_thread
(
self
.
request
,
self
.
thread_id
)
@ddt.data
(
*
itertools
.
product
(
[
...
...
lms/djangoapps/discussion_api/tests/test_views.py
View file @
e492aa23
...
...
@@ -588,7 +588,6 @@ class ThreadViewSetDeleteTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
thread_id
=
"test_thread"
def
test_basic
(
self
):
#from nose.tools import set_trace;set_trace()
self
.
register_get_user_response
(
self
.
user
)
cs_thread
=
make_minimal_cs_thread
({
"id"
:
self
.
thread_id
,
...
...
@@ -608,7 +607,6 @@ class ThreadViewSetDeleteTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase):
self
.
assertEqual
(
httpretty
.
last_request
()
.
method
,
"DELETE"
)
def
test_delete_nonexistent_thread
(
self
):
#from nose.tools import set_trace;set_trace()
self
.
register_get_thread_error_response
(
self
.
thread_id
,
404
)
response
=
self
.
client
.
delete
(
self
.
url
)
self
.
assertEqual
(
response
.
status_code
,
404
)
...
...
lms/djangoapps/discussion_api/views.py
View file @
e492aa23
...
...
@@ -19,10 +19,11 @@ from discussion_api.api import (
get_comment_list
,
get_course
,
get_course_topics
,
get_thread
,
get_thread_list
,
update_comment
,
update_thread
,
get_thread
)
)
from
discussion_api.forms
import
CommentListGetForm
,
ThreadListGetForm
from
openedx.core.lib.api.view_utils
import
DeveloperErrorViewMixin
...
...
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