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
006b90af
Commit
006b90af
authored
Aug 08, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify cms acceptance tests to use auto_auth workflow.
parent
8414ef02
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
22 deletions
+19
-22
cms/djangoapps/contentstore/features/common.py
+5
-15
cms/envs/acceptance.py
+3
-0
common/djangoapps/terrain/course_helpers.py
+4
-0
common/djangoapps/terrain/steps.py
+3
-3
lms/djangoapps/courseware/features/common.py
+1
-1
lms/djangoapps/courseware/features/navigation.py
+1
-1
lms/djangoapps/courseware/features/openended.py
+2
-2
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
006b90af
...
@@ -144,22 +144,10 @@ def log_into_studio(
...
@@ -144,22 +144,10 @@ def log_into_studio(
email
=
'robot+studio@edx.org'
,
email
=
'robot+studio@edx.org'
,
password
=
'test'
):
password
=
'test'
):
world
.
browser
.
cookies
.
delete
()
world
.
log_in
(
username
=
uname
,
password
=
password
,
email
=
email
,
name
=
'Robot Studio'
)
# Navigate to the studio dashboard
world
.
visit
(
'/'
)
world
.
visit
(
'/'
)
signin_css
=
'a.action-signin'
world
.
is_css_present
(
signin_css
)
world
.
css_click
(
signin_css
)
def
fill_login_form
():
login_form
=
world
.
browser
.
find_by_css
(
'form#login_form'
)
login_form
.
find_by_name
(
'email'
)
.
fill
(
email
)
login_form
.
find_by_name
(
'password'
)
.
fill
(
password
)
login_form
.
find_by_name
(
'submit'
)
.
click
()
world
.
retry_on_exception
(
fill_login_form
)
assert_true
(
world
.
is_css_present
(
'.new-course-button'
))
world
.
scenario_dict
[
'USER'
]
=
get_user_by_email
(
email
)
def
create_a_course
():
def
create_a_course
():
course
=
world
.
CourseFactory
.
create
(
org
=
'MITx'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
course
=
world
.
CourseFactory
.
create
(
org
=
'MITx'
,
course
=
'999'
,
display_name
=
'Robot Super Course'
)
...
@@ -176,7 +164,9 @@ def create_a_course():
...
@@ -176,7 +164,9 @@ def create_a_course():
group
,
__
=
Group
.
objects
.
get_or_create
(
name
=
groupname
)
group
,
__
=
Group
.
objects
.
get_or_create
(
name
=
groupname
)
user
.
groups
.
add
(
group
)
user
.
groups
.
add
(
group
)
user
.
save
()
user
.
save
()
world
.
browser
.
reload
()
# Navigate to the studio dashboard
world
.
visit
(
'/'
)
course_link_css
=
'a.course-link'
course_link_css
=
'a.course-link'
world
.
css_click
(
course_link_css
)
world
.
css_click
(
course_link_css
)
course_title_css
=
'span.course-title'
course_title_css
=
'span.course-title'
...
...
cms/envs/acceptance.py
View file @
006b90af
...
@@ -72,6 +72,9 @@ DATABASES = {
...
@@ -72,6 +72,9 @@ DATABASES = {
}
}
}
}
# Use the auto_auth workflow for creating users and logging them in
MITX_FEATURES
[
'AUTOMATIC_AUTH_FOR_TESTING'
]
=
True
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS
+=
(
'lettuce.django'
,)
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'contentstore'
,)
LETTUCE_APPS
=
(
'contentstore'
,)
...
...
common/djangoapps/terrain/course_helpers.py
View file @
006b90af
...
@@ -42,6 +42,10 @@ def log_in(username='robot', password='test', email='robot@edx.org', name='Robot
...
@@ -42,6 +42,10 @@ def log_in(username='robot', password='test', email='robot@edx.org', name='Robot
password
,
name
,
email
)
password
,
name
,
email
)
world
.
visit
(
url
)
world
.
visit
(
url
)
# Save the user info in the world scenario_dict for use in the tests
user
=
User
.
objects
.
get
(
username
=
username
)
world
.
scenario_dict
[
'USER'
]
=
user
@world.absorb
@world.absorb
def
register_by_course_id
(
course_id
,
is_staff
=
False
):
def
register_by_course_id
(
course_id
,
is_staff
=
False
):
...
...
common/djangoapps/terrain/steps.py
View file @
006b90af
...
@@ -88,13 +88,13 @@ def the_page_title_should_contain(step, title):
...
@@ -88,13 +88,13 @@ def the_page_title_should_contain(step, title):
@step
(
'I log in$'
)
@step
(
'I log in$'
)
def
i_log_in
(
step
):
def
i_log_in
(
step
):
world
.
log_in
(
'robot'
,
'test'
)
world
.
log_in
(
username
=
'robot'
,
password
=
'test'
)
@step
(
'I am a logged in user$'
)
@step
(
'I am a logged in user$'
)
def
i_am_logged_in_user
(
step
):
def
i_am_logged_in_user
(
step
):
world
.
create_user
(
'robot'
,
'test'
)
world
.
create_user
(
'robot'
,
'test'
)
world
.
log_in
(
'robot'
,
'test'
)
world
.
log_in
(
username
=
'robot'
,
password
=
'test'
)
@step
(
'I am not logged in$'
)
@step
(
'I am not logged in$'
)
...
@@ -147,7 +147,7 @@ def should_see_in_the_page(step, doesnt_appear, text):
...
@@ -147,7 +147,7 @@ def should_see_in_the_page(step, doesnt_appear, text):
@step
(
'I am logged in$'
)
@step
(
'I am logged in$'
)
def
i_am_logged_in
(
step
):
def
i_am_logged_in
(
step
):
world
.
create_user
(
'robot'
,
'test'
)
world
.
create_user
(
'robot'
,
'test'
)
world
.
log_in
(
'robot'
,
'test'
)
world
.
log_in
(
username
=
'robot'
,
password
=
'test'
)
world
.
browser
.
visit
(
django_url
(
'/'
))
world
.
browser
.
visit
(
django_url
(
'/'
))
# You should not see the login link
# You should not see the login link
assert_equals
(
world
.
browser
.
find_by_css
(
'a#login'
),
[])
assert_equals
(
world
.
browser
.
find_by_css
(
'a#login'
),
[])
...
...
lms/djangoapps/courseware/features/common.py
View file @
006b90af
...
@@ -55,7 +55,7 @@ def i_am_registered_for_the_course(step, course):
...
@@ -55,7 +55,7 @@ def i_am_registered_for_the_course(step, course):
# TODO: change to factory
# TODO: change to factory
CourseEnrollment
.
objects
.
get_or_create
(
user
=
u
,
course_id
=
course_id
(
course
))
CourseEnrollment
.
objects
.
get_or_create
(
user
=
u
,
course_id
=
course_id
(
course
))
world
.
log_in
(
'robot'
,
'test'
)
world
.
log_in
(
username
=
'robot'
,
password
=
'test'
)
@step
(
u'The course "([^"]*)" has extra tab "([^"]*)"$'
)
@step
(
u'The course "([^"]*)" has extra tab "([^"]*)"$'
)
...
...
lms/djangoapps/courseware/features/navigation.py
View file @
006b90af
...
@@ -151,7 +151,7 @@ def create_user_and_visit_course():
...
@@ -151,7 +151,7 @@ def create_user_and_visit_course():
CourseEnrollment
.
objects
.
get_or_create
(
user
=
u
,
course_id
=
course_id
(
world
.
scenario_dict
[
'COURSE'
]
.
number
))
CourseEnrollment
.
objects
.
get_or_create
(
user
=
u
,
course_id
=
course_id
(
world
.
scenario_dict
[
'COURSE'
]
.
number
))
world
.
log_in
(
'robot'
,
'test'
)
world
.
log_in
(
username
=
'robot'
,
password
=
'test'
)
chapter_name
=
(
TEST_SECTION_NAME
+
"1"
)
.
replace
(
" "
,
"_"
)
chapter_name
=
(
TEST_SECTION_NAME
+
"1"
)
.
replace
(
" "
,
"_"
)
section_name
=
(
TEST_SUBSECTION_NAME
+
"1"
)
.
replace
(
" "
,
"_"
)
section_name
=
(
TEST_SUBSECTION_NAME
+
"1"
)
.
replace
(
" "
,
"_"
)
url
=
django_url
(
'/courses/edx/model_course/Test_Course/courseware/
%
s/
%
s'
%
url
=
django_url
(
'/courses/edx/model_course/Test_Course/courseware/
%
s/
%
s'
%
...
...
lms/djangoapps/courseware/features/openended.py
View file @
006b90af
...
@@ -11,7 +11,7 @@ logger = getLogger(__name__)
...
@@ -11,7 +11,7 @@ logger = getLogger(__name__)
@step
(
'I navigate to an openended question$'
)
@step
(
'I navigate to an openended question$'
)
def
navigate_to_an_openended_question
(
step
):
def
navigate_to_an_openended_question
(
step
):
world
.
register_by_course_id
(
'MITx/3.091x/2012_Fall'
)
world
.
register_by_course_id
(
'MITx/3.091x/2012_Fall'
)
world
.
log_in
(
'robot@edx.org'
,
'test'
)
world
.
log_in
(
email
=
'robot@edx.org'
,
password
=
'test'
)
problem
=
'/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/'
problem
=
'/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/'
world
.
browser
.
visit
(
django_url
(
problem
))
world
.
browser
.
visit
(
django_url
(
problem
))
tab_css
=
'ol#sequence-list > li > a[data-element="5"]'
tab_css
=
'ol#sequence-list > li > a[data-element="5"]'
...
@@ -21,7 +21,7 @@ def navigate_to_an_openended_question(step):
...
@@ -21,7 +21,7 @@ def navigate_to_an_openended_question(step):
@step
(
'I navigate to an openended question as staff$'
)
@step
(
'I navigate to an openended question as staff$'
)
def
navigate_to_an_openended_question_as_staff
(
step
):
def
navigate_to_an_openended_question_as_staff
(
step
):
world
.
register_by_course_id
(
'MITx/3.091x/2012_Fall'
,
True
)
world
.
register_by_course_id
(
'MITx/3.091x/2012_Fall'
,
True
)
world
.
log_in
(
'robot@edx.org'
,
'test'
)
world
.
log_in
(
email
=
'robot@edx.org'
,
password
=
'test'
)
problem
=
'/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/'
problem
=
'/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/'
world
.
browser
.
visit
(
django_url
(
problem
))
world
.
browser
.
visit
(
django_url
(
problem
))
tab_css
=
'ol#sequence-list > li > a[data-element="5"]'
tab_css
=
'ol#sequence-list > li > a[data-element="5"]'
...
...
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