Merge pull request #9737 from edx/jia/MA-1182_feedback
MA-1182 - updated
This commit is contained in:
@@ -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(
|
||||
[
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user