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
44061f9c
Commit
44061f9c
authored
Jun 10, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert bad merge
parent
5a8e4bff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
cms/djangoapps/contentstore/features/section.py
+24
-18
No files found.
cms/djangoapps/contentstore/features/section.py
View file @
44061f9c
...
...
@@ -9,34 +9,34 @@ from nose.tools import assert_equal
@step
(
'I click the new section link$'
)
def
i_click_new_section_link
(
step
):
def
i_click_new_section_link
(
_
step
):
link_css
=
'a.new-courseware-section-button'
world
.
css_click
(
link_css
)
@step
(
'I enter the section name and click save$'
)
def
i_save_section_name
(
step
):
def
i_save_section_name
(
_
step
):
save_section_name
(
'My Section'
)
@step
(
'I enter a section name with a quote and click save$'
)
def
i_save_section_name_with_quote
(
step
):
def
i_save_section_name_with_quote
(
_
step
):
save_section_name
(
'Section with "Quote"'
)
@step
(
'I have added a new section$'
)
def
i_have_added_new_section
(
step
):
def
i_have_added_new_section
(
_
step
):
add_section
()
@step
(
'I click the Edit link for the release date$'
)
def
i_click_the_edit_link_for_the_release_date
(
step
):
def
i_click_the_edit_link_for_the_release_date
(
_
step
):
button_css
=
'div.section-published-date a.edit-button'
world
.
css_click
(
button_css
)
@step
(
'I save a new section release date$'
)
def
i_save_a_new_section_release_date
(
step
):
def
i_save_a_new_section_release_date
(
_
step
):
set_date_and_time
(
'input.start-date.date.hasDatepicker'
,
'12/25/2013'
,
'input.start-time.time.ui-timepicker-input'
,
'00:00'
)
world
.
browser
.
click_link_by_text
(
'Save'
)
...
...
@@ -46,35 +46,35 @@ def i_save_a_new_section_release_date(step):
@step
(
'I see my section on the Courseware page$'
)
def
i_see_my_section_on_the_courseware_page
(
step
):
def
i_see_my_section_on_the_courseware_page
(
_
step
):
see_my_section_on_the_courseware_page
(
'My Section'
)
@step
(
'I see my section name with a quote on the Courseware page$'
)
def
i_see_my_section_name_with_quote_on_the_courseware_page
(
step
):
def
i_see_my_section_name_with_quote_on_the_courseware_page
(
_
step
):
see_my_section_on_the_courseware_page
(
'Section with "Quote"'
)
@step
(
'I click to edit the section name$'
)
def
i_click_to_edit_section_name
(
step
):
def
i_click_to_edit_section_name
(
_
step
):
world
.
css_click
(
'span.section-name-span'
)
@step
(
'I see the complete section name with a quote in the editor$'
)
def
i_see_complete_section_name_with_quote_in_editor
(
step
):
def
i_see_complete_section_name_with_quote_in_editor
(
_
step
):
css
=
'.section-name-edit input[type=text]'
assert
world
.
is_css_present
(
css
)
assert_equal
(
world
.
browser
.
find_by_css
(
css
)
.
value
,
'Section with "Quote"'
)
@step
(
'the section does not exist$'
)
def
section_does_not_exist
(
step
):
def
section_does_not_exist
(
_
step
):
css
=
'h3[data-name="My Section"]'
assert
world
.
is_css_not_present
(
css
)
@step
(
'I see a release date for my section$'
)
def
i_see_a_release_date_for_my_section
(
step
):
def
i_see_a_release_date_for_my_section
(
_
step
):
import
re
css
=
'span.published-status'
...
...
@@ -83,26 +83,32 @@ def i_see_a_release_date_for_my_section(step):
# e.g. 11/06/2012 at 16:25
msg
=
'Will Release:'
date_regex
=
'[01][0-9]
\
/[0-3][0-9]
\
/[12][0-9][0-9][0-9]'
time_regex
=
'[0-2][0-9]:[0-5][0-9]'
match_string
=
'
%
s
%
s at
%
s'
%
(
msg
,
date_regex
,
time_regex
)
date_regex
=
r'(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d\d?, \d{4}'
if
not
re
.
search
(
date_regex
,
status_text
):
print
status_text
,
date_regex
time_regex
=
r'[0-2]\d:[0-5]\d( \w{3})?'
if
not
re
.
search
(
time_regex
,
status_text
):
print
status_text
,
time_regex
match_string
=
r'
%
s\s+
%
s at
%
s'
%
(
msg
,
date_regex
,
time_regex
)
if
not
re
.
match
(
match_string
,
status_text
):
print
status_text
,
match_string
assert
re
.
match
(
match_string
,
status_text
)
@step
(
'I see a link to create a new subsection$'
)
def
i_see_a_link_to_create_a_new_subsection
(
step
):
def
i_see_a_link_to_create_a_new_subsection
(
_
step
):
css
=
'a.new-subsection-item'
assert
world
.
is_css_present
(
css
)
@step
(
'the section release date picker is not visible$'
)
def
the_section_release_date_picker_not_visible
(
step
):
def
the_section_release_date_picker_not_visible
(
_
step
):
css
=
'div.edit-subsection-publish-settings'
assert
not
world
.
css_visible
(
css
)
@step
(
'the section release date is updated$'
)
def
the_section_release_date_is_updated
(
step
):
def
the_section_release_date_is_updated
(
_
step
):
css
=
'span.published-status'
status_text
=
world
.
css_text
(
css
)
assert_equal
(
status_text
,
'Will Release: 12/25/2013 at 00:00 UTC'
)
...
...
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