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
d8a79016
Commit
d8a79016
authored
Aug 01, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a lettuce test for removing own admin permission on course team
parent
53ae1771
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
cms/djangoapps/contentstore/features/course-team.feature
+13
-0
cms/djangoapps/contentstore/features/course-team.py
+19
-0
No files found.
cms/djangoapps/contentstore/features/course-team.feature
View file @
d8a79016
...
...
@@ -71,3 +71,16 @@ Feature: Course Team
And
she deletes me from the course team
And
I log in
Then
I do not see the course on my page
Scenario
:
Admins should be able to remove their own admin rights
Given
I have opened a new course in Studio
And
the user
"harry"
exists as a course admin
And
I am viewing the course team settings
Then
I should be marked as an admin
And
I can add users
And
I can delete users
When
I remove admin rights from myself
Then
I should not be marked as an admin
And
I cannot add users
And
I cannot delete users
And
I cannot make myself a course team admin
cms/djangoapps/contentstore/features/course-team.py
View file @
d8a79016
...
...
@@ -112,6 +112,11 @@ def marked_as_admin(_step, name, inverted):
assert
world
.
is_css_present
(
flag_css
)
@step
(
u'I should( not)? be marked as an admin'
)
def
self_marked_as_admin
(
_step
,
inverted
):
return
marked_as_admin
(
_step
,
"robot+studio"
,
inverted
)
@step
(
u'I can(not)? delete users'
)
@step
(
u's?he can(not)? delete users'
)
def
can_delete_users
(
_step
,
inverted
):
...
...
@@ -130,3 +135,17 @@ def can_add_users(_step, inverted):
assert
world
.
is_css_not_present
(
add_css
)
else
:
assert
world
.
is_css_present
(
add_css
)
@step
(
u'I can(not)? make ("([^"]*)"|myself) a course team admin'
)
@step
(
u's?he can(not)? make ("([^"]*)"|me) a course team admin'
)
def
can_make_course_admin
(
_step
,
inverted
,
outer_capture
,
name
):
if
outer_capture
==
"myself"
:
email
=
world
.
scenario_dict
[
"USER"
]
.
email
else
:
email
=
name
+
EMAIL_EXTENSION
add_button_css
=
'.user-item[data-email="{email}"] .add-admin-role'
.
format
(
email
=
email
)
if
inverted
:
assert
world
.
is_css_not_present
(
add_button_css
)
else
:
assert
world
.
is_css_present
(
add_button_css
)
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