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
9c58489b
Commit
9c58489b
authored
Aug 07, 2015
by
Peter Fogg
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9223 from edx/peter-fogg/discussion-admin-delete
Ensure that discussion admins can delete team posts.
parents
e09f9ac4
90d87747
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
lms/djangoapps/django_comment_client/base/tests.py
+32
-0
No files found.
lms/djangoapps/django_comment_client/base/tests.py
View file @
9c58489b
...
...
@@ -1211,6 +1211,38 @@ class TeamsPermissionsTestCase(UrlResetMixin, ModuleStoreTestCase, MockRequestSe
)
self
.
assertEqual
(
response
.
status_code
,
status_code
)
@ddt.data
(
# Students can delete their own posts
(
'student_in_team'
,
'student_in_team'
,
'team_commentable_id'
,
200
),
# Moderators can delete any post
(
'moderator'
,
'student_in_team'
,
'team_commentable_id'
,
200
),
# Others cannot delete posts
(
'student_in_team'
,
'moderator'
,
'team_commentable_id'
,
401
),
(
'student_not_in_team'
,
'student_in_team'
,
'team_commentable_id'
,
401
)
)
@ddt.unpack
def
test_delete_comment
(
self
,
user
,
comment_author
,
commentable_id
,
status_code
,
mock_request
):
commentable_id
=
getattr
(
self
,
commentable_id
)
comment_author
=
getattr
(
self
,
comment_author
)
self
.
_setup_mock
(
user
,
mock_request
,
{
"closed"
:
False
,
"commentable_id"
:
commentable_id
,
"user_id"
:
str
(
comment_author
.
id
)
})
response
=
self
.
client
.
post
(
reverse
(
"delete_comment"
,
kwargs
=
{
"course_id"
:
unicode
(
self
.
course
.
id
),
"comment_id"
:
"dummy"
}
),
data
=
{
"body"
:
"foo"
,
"title"
:
"foo"
}
)
self
.
assertEqual
(
response
.
status_code
,
status_code
)
@ddt.data
(
*
ddt_permissions_args
)
@ddt.unpack
def
test_create_comment
(
self
,
user
,
commentable_id
,
status_code
,
mock_request
):
...
...
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