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
eaac4f8b
Commit
eaac4f8b
authored
Jul 30, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a lettuce test for course team admins removing admin status
parent
573445aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
cms/djangoapps/contentstore/features/common.py
+2
-0
cms/djangoapps/contentstore/features/course-team.feature
+12
-0
cms/djangoapps/contentstore/features/course-team.py
+18
-3
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
eaac4f8b
...
...
@@ -126,6 +126,8 @@ def create_studio_user(
registration
.
register
(
studio_user
)
registration
.
activate
()
return
studio_user
def
fill_in_course_info
(
name
=
'Robot Super Course'
,
...
...
cms/djangoapps/contentstore/features/course-team.feature
View file @
eaac4f8b
...
...
@@ -45,3 +45,15 @@ Feature: Course Team
Then
"emily"
should
be
marked
as
an
admin
And
she can add users
And
she can delete users
Scenario
:
Admins should be able to remove other admins
Given
I have opened a new course in Studio
And
the user
"frank"
exists as a course admin
And
I am viewing the course team settings
When
I remove admin rights from
"frank"
And
"frank"
logs
in
And
he selects the new course
And
he views the course team settings
Then
"frank"
should
not
be
marked
as
an
admin
And
he cannot add users
And
he cannot delete users
cms/djangoapps/contentstore/features/course-team.py
View file @
eaac4f8b
...
...
@@ -3,6 +3,8 @@
from
lettuce
import
world
,
step
from
common
import
create_studio_user
,
log_into_studio
from
django.contrib.auth.models
import
Group
from
auth.authz
import
get_course_groupname_for_role
PASSWORD
=
'test'
EMAIL_EXTENSION
=
'@edx.org'
...
...
@@ -15,9 +17,15 @@ def view_grading_settings(_step, whom):
world
.
css_click
(
link_css
)
@step
(
u'the user "([^"]*)" exists$'
)
def
create_other_user
(
_step
,
name
):
create_studio_user
(
uname
=
name
,
password
=
PASSWORD
,
email
=
(
name
+
EMAIL_EXTENSION
))
@step
(
u'the user "([^"]*)" exists( as a course admin)?$'
)
def
create_other_user
(
_step
,
name
,
course_admin
):
user
=
create_studio_user
(
uname
=
name
,
password
=
PASSWORD
,
email
=
(
name
+
EMAIL_EXTENSION
))
if
course_admin
:
location
=
world
.
scenario_dict
[
"COURSE"
]
.
location
for
role
in
(
"staff"
,
"instructor"
):
group
,
__
=
Group
.
objects
.
get_or_create
(
name
=
get_course_groupname_for_role
(
location
,
role
))
user
.
groups
.
add
(
group
)
user
.
save
()
@step
(
u'I add "([^"]*)" to the course team'
)
...
...
@@ -48,6 +56,13 @@ def make_course_team_admin(_step, name):
world
.
css_click
(
admin_btn_css
)
@step
(
u'I remove admin rights from "([^"]*)"'
)
def
remove_course_team_admin
(
_step
,
name
):
admin_btn_css
=
'.user-item[data-email="{email}"] .user-actions .remove-admin-role'
.
format
(
email
=
name
+
EMAIL_EXTENSION
)
world
.
css_click
(
admin_btn_css
)
@step
(
u'"([^"]*)" logs in$'
)
def
other_user_login
(
_step
,
name
):
log_into_studio
(
uname
=
name
,
password
=
PASSWORD
,
email
=
name
+
EMAIL_EXTENSION
)
...
...
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