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
86afe727
Commit
86afe727
authored
May 30, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor user factory usage for lettuce tests. Fix merge conflict.
parent
1c209789
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
22 deletions
+14
-22
cms/djangoapps/contentstore/features/common.py
+7
-7
cms/djangoapps/contentstore/features/problem-editor.py
+3
-12
cms/djangoapps/contentstore/features/subsection.py
+1
-3
common/djangoapps/terrain/factories.py
+3
-0
No files found.
cms/djangoapps/contentstore/features/common.py
View file @
86afe727
...
...
@@ -50,31 +50,31 @@ def i_press_the_category_delete_icon(step, category):
@step
(
'I have opened a new course in Studio$'
)
def
i_have_opened_a_new_course
(
step
):
open_new_course
()
####### HELPER FUNCTIONS ##############
def
open_new_course
():
world
.
clear_courses
()
log_into_studio
()
create_a_course
()
####### HELPER FUNCTIONS ##############
def
create_studio_user
(
uname
=
'robot'
,
email
=
'robot+studio@edx.org'
,
password
=
'test'
,
is_staff
=
False
):
studio_user
=
world
.
UserFactory
.
build
(
studio_user
=
world
.
UserFactory
(
username
=
uname
,
email
=
email
,
password
=
password
,
is_staff
=
is_staff
)
studio_user
.
set_password
(
password
)
studio_user
.
save
()
registration
=
world
.
RegistrationFactory
(
user
=
studio_user
)
registration
.
register
(
studio_user
)
registration
.
activate
()
user_profile
=
world
.
UserProfileFactory
(
user
=
studio_user
)
def
fill_in_course_info
(
name
=
'Robot Super Course'
,
...
...
@@ -153,4 +153,4 @@ def set_date_and_time(date_css, desired_date, time_css, desired_time):
world
.
css_fill
(
time_css
,
desired_time
)
e
=
world
.
css_find
(
time_css
)
.
first
e
.
_element
.
send_keys
(
Keys
.
TAB
)
time
.
sleep
(
float
(
1
))
time
.
sleep
(
float
(
1
))
cms/djangoapps/contentstore/features/problem-editor.py
View file @
86afe727
...
...
@@ -14,8 +14,6 @@ SHOW_ANSWER = "Show Answer"
############### ACTIONS ####################
@step
(
'I have created a Blank Common Problem$'
)
def
i_created_blank_common_problem
(
step
):
world
.
create_component_instance
(
step
,
'.large-problem-icon'
,
'i4x://edx/templates/problem/Blank_Common_Problem'
,
'.xmodule_CapaModule'
)
world
.
create_component_instance
(
step
,
'.large-problem-icon'
,
...
...
@@ -96,7 +94,6 @@ def i_can_revert_to_default_for_randomization(step):
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
RANDOMIZATION
),
RANDOMIZATION
,
"Always"
,
False
)
@step
(
'I can set the weight to 3.5'
)
def
i_can_set_weight_to_3_5
(
step
):
world
.
get_setting_entry
(
PROBLEM_WEIGHT
)
.
find_by_css
(
'.setting-input'
)[
0
]
.
fill
(
'3.5'
)
...
...
@@ -104,19 +101,18 @@ def i_can_set_weight_to_3_5(step):
@step
(
'my change to weight is persisted'
)
def
my_change_to_
randomization
_is_persisted
(
step
):
def
my_change_to_
weight
_is_persisted
(
step
):
world
.
save_component_and_reopen
(
step
)
verify_modified_weight
()
@step
(
'I can revert to the default value of unset for weight'
)
def
i_can_revert_to_default_for_
randomization
(
step
):
def
i_can_revert_to_default_for_
unset_weight
(
step
):
world
.
revert_setting_entry
(
PROBLEM_WEIGHT
)
world
.
save_component_and_reopen
(
step
)
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
PROBLEM_WEIGHT
),
PROBLEM_WEIGHT
,
""
,
False
)
@step
(
'if I set the weight to abc, it remains unset'
)
def
set_the_weight_to_abc
(
step
):
world
.
get_setting_entry
(
PROBLEM_WEIGHT
)
.
find_by_css
(
'.setting-input'
)[
0
]
.
fill
(
'abc'
)
...
...
@@ -127,16 +123,14 @@ def set_the_weight_to_abc(step):
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
PROBLEM_WEIGHT
),
PROBLEM_WEIGHT
,
""
,
False
)
@step
(
'if I set the max attempts to 2.34, the max attempts are persisted as 234'
)
def
set_the_
weight_to_abc
(
step
):
def
set_the_
max_attempts_234
(
step
):
world
.
get_setting_entry
(
MAXIMUM_ATTEMPTS
)
.
find_by_css
(
'.setting-input'
)[
0
]
.
fill
(
'2.34'
)
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
MAXIMUM_ATTEMPTS
),
MAXIMUM_ATTEMPTS
,
"234"
,
True
)
world
.
save_component_and_reopen
(
step
)
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
MAXIMUM_ATTEMPTS
),
MAXIMUM_ATTEMPTS
,
"234"
,
True
)
@step
(
'I set the max attempts to -3, the max attempts are persisted as 1'
)
def
set_max_attempts_to_neg_3
(
step
):
world
.
get_setting_entry
(
MAXIMUM_ATTEMPTS
)
.
find_by_css
(
'.setting-input'
)[
0
]
.
fill
(
'-3'
)
...
...
@@ -145,7 +139,6 @@ def set_max_attempts_to_neg_3(step):
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
MAXIMUM_ATTEMPTS
),
MAXIMUM_ATTEMPTS
,
"1"
,
True
)
@step
(
'Edit High Level Source is not visible'
)
def
edit_high_level_source_not_visible
(
step
):
verify_high_level_source
(
step
,
False
)
...
...
@@ -182,12 +175,10 @@ def verify_modified_weight():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
PROBLEM_WEIGHT
),
PROBLEM_WEIGHT
,
"3.5"
,
True
)
def
verify_modified_randomization
():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
RANDOMIZATION
),
RANDOMIZATION
,
"Per Student"
,
True
)
def
verify_modified_display_name
():
world
.
verify_setting_entry
(
world
.
get_setting_entry
(
DISPLAY_NAME
),
DISPLAY_NAME
,
'modified'
,
True
)
...
...
cms/djangoapps/contentstore/features/subsection.py
View file @
86afe727
...
...
@@ -10,9 +10,7 @@ from nose.tools import assert_equal
@step
(
'I have opened a new course section in Studio$'
)
def
i_have_opened_a_new_course_section
(
step
):
world
.
clear_courses
()
log_into_studio
()
create_a_course
()
open_new_course
()
add_section
()
...
...
common/djangoapps/terrain/factories.py
View file @
86afe727
...
...
@@ -13,6 +13,7 @@ class UserFactory(sf.UserFactory):
"""
User account for lms / cms
"""
FACTORY_DJANGO_GET_OR_CREATE
=
(
'username'
,)
pass
...
...
@@ -21,6 +22,7 @@ class UserProfileFactory(sf.UserProfileFactory):
"""
Demographics etc for the User
"""
FACTORY_DJANGO_GET_OR_CREATE
=
(
'user'
,)
pass
...
...
@@ -29,6 +31,7 @@ class RegistrationFactory(sf.RegistrationFactory):
"""
Activation key for registering the user account
"""
FACTORY_DJANGO_GET_OR_CREATE
=
(
'user'
,)
pass
...
...
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