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
76bc4fb9
Commit
76bc4fb9
authored
8 years ago
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 29 anomalous-backslash-in-string errors
parent
ecffdacf
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
25 additions
and
24 deletions
+25
-24
cms/djangoapps/contentstore/features/textbooks.py
+1
-1
cms/djangoapps/contentstore/features/transcripts.py
+3
-3
common/lib/capa/capa/inputtypes.py
+1
-1
common/lib/capa/capa/responsetypes.py
+1
-1
common/lib/capa/capa/tests/test_responsetypes.py
+5
-5
lms/djangoapps/courseware/features/lti.py
+1
-1
lms/djangoapps/instructor/features/data_download.py
+1
-1
lms/djangoapps/shoppingcart/processors/CyberSource.py
+3
-3
lms/djangoapps/shoppingcart/processors/CyberSource2.py
+3
-3
lms/djangoapps/student_account/test/test_views.py
+1
-1
lms/envs/cms/dev.py
+5
-4
No files found.
cms/djangoapps/contentstore/features/textbooks.py
View file @
76bc4fb9
...
@@ -89,7 +89,7 @@ def check_textbook(_step, textbook_name, chapter_name):
...
@@ -89,7 +89,7 @@ def check_textbook(_step, textbook_name, chapter_name):
assert_equal
(
chapter
,
chapter_name
)
assert_equal
(
chapter
,
chapter_name
)
@step
(
u
'I should see a textbook named "([^"]*)" with (
\
d+) chapters'
)
@step
(
r
'I should see a textbook named "([^"]*)" with (\d+) chapters'
)
def
check_textbook_chapters
(
_step
,
textbook_name
,
num_chapters_str
):
def
check_textbook_chapters
(
_step
,
textbook_name
,
num_chapters_str
):
num_chapters
=
int
(
num_chapters_str
)
num_chapters
=
int
(
num_chapters_str
)
title
=
world
.
css_text
(
".textbook .view-textbook h3.textbook-title"
,
index
=
0
)
title
=
world
.
css_text
(
".textbook .view-textbook h3.textbook-title"
,
index
=
0
)
...
...
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/features/transcripts.py
View file @
76bc4fb9
...
@@ -134,7 +134,7 @@ def i_see_button(_step, not_see, button_type):
...
@@ -134,7 +134,7 @@ def i_see_button(_step, not_see, button_type):
assert
world
.
css_has_text
(
TRANSCRIPTS_BUTTONS
[
button
][
0
],
TRANSCRIPTS_BUTTONS
[
button
][
1
])
assert
world
.
css_has_text
(
TRANSCRIPTS_BUTTONS
[
button
][
0
],
TRANSCRIPTS_BUTTONS
[
button
][
1
])
@step
(
'I (.*)see (.*)button "([^"]*)" number (
\
d+)$'
)
@step
(
r
'I (.*)see (.*)button "([^"]*)" number (\d+)$'
)
def
i_see_button_with_custom_text
(
_step
,
not_see
,
button_type
,
custom_text
,
index
):
def
i_see_button_with_custom_text
(
_step
,
not_see
,
button_type
,
custom_text
,
index
):
button
=
button_type
.
strip
()
button
=
button_type
.
strip
()
custom_text
=
custom_text
.
strip
()
custom_text
=
custom_text
.
strip
()
...
@@ -153,7 +153,7 @@ def click_button_transcripts_variant(_step, button_type):
...
@@ -153,7 +153,7 @@ def click_button_transcripts_variant(_step, button_type):
world
.
wait_for_ajax_complete
()
world
.
wait_for_ajax_complete
()
@step
(
'I click transcript button "([^"]*)" number (
\
d+)$'
)
@step
(
r
'I click transcript button "([^"]*)" number (\d+)$'
)
def
click_button_index
(
_step
,
button_type
,
index
):
def
click_button_index
(
_step
,
button_type
,
index
):
button
=
button_type
.
strip
()
button
=
button_type
.
strip
()
index
=
int
(
index
.
strip
())
-
1
index
=
int
(
index
.
strip
())
-
1
...
@@ -178,7 +178,7 @@ def remove_transcripts_from_store(_step, subs_id):
...
@@ -178,7 +178,7 @@ def remove_transcripts_from_store(_step, subs_id):
print
'Transcript file was NOT found and not removed.'
print
'Transcript file was NOT found and not removed.'
@step
(
'I enter a "([^"]+)" source to field number (
\
d+)$'
)
@step
(
r
'I enter a "([^"]+)" source to field number (\d+)$'
)
def
i_enter_a_source
(
_step
,
link
,
index
):
def
i_enter_a_source
(
_step
,
link
,
index
):
index
=
int
(
index
)
-
1
index
=
int
(
index
)
-
1
...
...
This diff is collapsed.
Click to expand it.
common/lib/capa/capa/inputtypes.py
View file @
76bc4fb9
...
@@ -1614,7 +1614,7 @@ class AnnotationInput(InputTypeBase):
...
@@ -1614,7 +1614,7 @@ class AnnotationInput(InputTypeBase):
@registry.register
@registry.register
class
ChoiceTextGroup
(
InputTypeBase
):
class
ChoiceTextGroup
(
InputTypeBase
):
"""
r
"""
Groups of radiobutton/checkboxes with text inputs.
Groups of radiobutton/checkboxes with text inputs.
Examples:
Examples:
...
...
This diff is collapsed.
Click to expand it.
common/lib/capa/capa/responsetypes.py
View file @
76bc4fb9
...
@@ -1942,7 +1942,7 @@ class NumericalResponse(LoncapaResponse):
...
@@ -1942,7 +1942,7 @@ class NumericalResponse(LoncapaResponse):
@registry.register
@registry.register
class
StringResponse
(
LoncapaResponse
):
class
StringResponse
(
LoncapaResponse
):
"""
r
"""
This response type allows one or more answers.
This response type allows one or more answers.
Additional answers are added by `additional_answer` tag.
Additional answers are added by `additional_answer` tag.
...
...
This diff is collapsed.
Click to expand it.
common/lib/capa/capa/tests/test_responsetypes.py
View file @
76bc4fb9
...
@@ -658,7 +658,7 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
...
@@ -658,7 +658,7 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
"Martin Luther King"
"Martin Luther King"
]
]
problem
=
self
.
build_problem
(
answer
=
"
\
w*
\
.?.*Luther King
\
s*.*"
,
case_sensitive
=
True
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
r
"\w*\.?.*Luther King\s*.*"
,
case_sensitive
=
True
,
regexp
=
True
)
for
answer
in
answers
:
for
answer
in
answers
:
self
.
assert_grade
(
problem
,
answer
,
"correct"
)
self
.
assert_grade
(
problem
,
answer
,
"correct"
)
...
@@ -699,7 +699,7 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
...
@@ -699,7 +699,7 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
self
.
assert_grade
(
problem
,
u"o"
,
"incorrect"
)
self
.
assert_grade
(
problem
,
u"o"
,
"incorrect"
)
def
test_backslash_and_unicode_regexps
(
self
):
def
test_backslash_and_unicode_regexps
(
self
):
"""
r
"""
Test some special cases of [unicode] regexps.
Test some special cases of [unicode] regexps.
One needs to use either r'' strings or write real `repr` of unicode strings, because of the following
One needs to use either r'' strings or write real `repr` of unicode strings, because of the following
...
@@ -715,14 +715,14 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
...
@@ -715,14 +715,14 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring
So a\d in front-end editor will become a\\\\d in xml, so it will match a1 as student answer.
So a\d in front-end editor will become a\\\\d in xml, so it will match a1 as student answer.
"""
"""
problem
=
self
.
build_problem
(
answer
=
ur"5\\æ"
,
case_sensitive
=
False
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
ur"5\\æ"
,
case_sensitive
=
False
,
regexp
=
True
)
self
.
assert_grade
(
problem
,
u"5
\
æ"
,
"correct"
)
self
.
assert_grade
(
problem
,
u
r
"5\æ"
,
"correct"
)
problem
=
self
.
build_problem
(
answer
=
u"5
\\\\
æ"
,
case_sensitive
=
False
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
u"5
\\\\
æ"
,
case_sensitive
=
False
,
regexp
=
True
)
self
.
assert_grade
(
problem
,
u"5
\
æ"
,
"correct"
)
self
.
assert_grade
(
problem
,
u
r
"5\æ"
,
"correct"
)
def
test_backslash
(
self
):
def
test_backslash
(
self
):
problem
=
self
.
build_problem
(
answer
=
u"a
\\\\
c1"
,
case_sensitive
=
False
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
u"a
\\\\
c1"
,
case_sensitive
=
False
,
regexp
=
True
)
self
.
assert_grade
(
problem
,
u"a
\
c1"
,
"correct"
)
self
.
assert_grade
(
problem
,
u
r
"a\c1"
,
"correct"
)
def
test_special_chars
(
self
):
def
test_special_chars
(
self
):
problem
=
self
.
build_problem
(
answer
=
ur"a \s1"
,
case_sensitive
=
False
,
regexp
=
True
)
problem
=
self
.
build_problem
(
answer
=
ur"a \s1"
,
case_sensitive
=
False
,
regexp
=
True
)
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/lti.py
View file @
76bc4fb9
...
@@ -150,7 +150,7 @@ def set_incorrect_lti_passport(_step):
...
@@ -150,7 +150,7 @@ def set_incorrect_lti_passport(_step):
i_am_registered_for_the_course
(
coursenum
,
metadata
)
i_am_registered_for_the_course
(
coursenum
,
metadata
)
@step
(
'the course has an LTI component with (.*) fields(?:
\
:)?$'
)
# , new_page is(.*), graded is(.*)
@step
(
r
'the course has an LTI component with (.*) fields(?:\:)?$'
)
# , new_page is(.*), graded is(.*)
def
add_correct_lti_to_course
(
_step
,
fields
):
def
add_correct_lti_to_course
(
_step
,
fields
):
category
=
'lti'
category
=
'lti'
metadata
=
{
metadata
=
{
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/features/data_download.py
View file @
76bc4fb9
...
@@ -74,7 +74,7 @@ def verify_report_is_generated(report_name_substring):
...
@@ -74,7 +74,7 @@ def verify_report_is_generated(report_name_substring):
world
.
wait_for_visible
(
'#report-downloads-table'
)
world
.
wait_for_visible
(
'#report-downloads-table'
)
# Find table and assert a .csv file is present
# Find table and assert a .csv file is present
quoted_id
=
http
.
urlquote
(
world
.
course_key
)
.
replace
(
'/'
,
'_'
)
quoted_id
=
http
.
urlquote
(
world
.
course_key
)
.
replace
(
'/'
,
'_'
)
expected_file_regexp
=
quoted_id
+
'_'
+
report_name_substring
+
'_
\
d{4}-
\
d{2}-
\
d{2}-
\
d{4}
\
.csv'
expected_file_regexp
=
quoted_id
+
'_'
+
report_name_substring
+
r
'_\d{4}-\d{2}-\d{2}-\d{4}\.csv'
assert_regexp_matches
(
assert_regexp_matches
(
world
.
css_html
(
'#report-downloads-table'
),
expected_file_regexp
,
world
.
css_html
(
'#report-downloads-table'
),
expected_file_regexp
,
msg
=
"Expected report filename was not found."
msg
=
"Expected report filename was not found."
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/shoppingcart/processors/CyberSource.py
View file @
76bc4fb9
...
@@ -219,9 +219,9 @@ def record_purchase(params, order):
...
@@ -219,9 +219,9 @@ def record_purchase(params, order):
Record the purchase and run purchased_callbacks
Record the purchase and run purchased_callbacks
"""
"""
ccnum_str
=
params
.
get
(
'card_accountNumber'
,
''
)
ccnum_str
=
params
.
get
(
'card_accountNumber'
,
''
)
m
=
re
.
search
(
"
\
d"
,
ccnum_str
)
first_digit
=
re
.
search
(
r
"\d"
,
ccnum_str
)
if
m
:
if
first_digit
:
ccnum
=
ccnum_str
[
m
.
start
():]
ccnum
=
ccnum_str
[
first_digit
.
start
():]
else
:
else
:
ccnum
=
"####"
ccnum
=
"####"
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/shoppingcart/processors/CyberSource2.py
View file @
76bc4fb9
...
@@ -404,9 +404,9 @@ def _record_purchase(params, order):
...
@@ -404,9 +404,9 @@ def _record_purchase(params, order):
# Parse the string to retrieve the digits.
# Parse the string to retrieve the digits.
# If we can't find any digits, use placeholder values instead.
# If we can't find any digits, use placeholder values instead.
ccnum_str
=
params
.
get
(
'req_card_number'
,
''
)
ccnum_str
=
params
.
get
(
'req_card_number'
,
''
)
mm
=
re
.
search
(
"
\
d"
,
ccnum_str
)
first_digit
=
re
.
search
(
r
"\d"
,
ccnum_str
)
if
mm
:
if
first_digit
:
ccnum
=
ccnum_str
[
mm
.
start
():]
ccnum
=
ccnum_str
[
first_digit
.
start
():]
else
:
else
:
ccnum
=
"####"
ccnum
=
"####"
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/student_account/test/test_views.py
View file @
76bc4fb9
...
@@ -100,7 +100,7 @@ class StudentAccountUpdateTest(CacheIsolationTestCase, UrlResetMixin):
...
@@ -100,7 +100,7 @@ class StudentAccountUpdateTest(CacheIsolationTestCase, UrlResetMixin):
# Retrieve the activation link from the email body
# Retrieve the activation link from the email body
email_body
=
mail
.
outbox
[
0
]
.
body
email_body
=
mail
.
outbox
[
0
]
.
body
result
=
re
.
search
(
'(?P<url>https?://[^
\
s]+)'
,
email_body
)
result
=
re
.
search
(
r
'(?P<url>https?://[^\s]+)'
,
email_body
)
self
.
assertIsNot
(
result
,
None
)
self
.
assertIsNot
(
result
,
None
)
activation_link
=
result
.
group
(
'url'
)
activation_link
=
result
.
group
(
'url'
)
...
...
This diff is collapsed.
Click to expand it.
lms/envs/cms/dev.py
View file @
76bc4fb9
...
@@ -38,9 +38,10 @@ DEBUG_TOOLBAR_PANELS += (
...
@@ -38,9 +38,10 @@ DEBUG_TOOLBAR_PANELS += (
'debug_toolbar_mongo.panel.MongoDebugPanel'
,
'debug_toolbar_mongo.panel.MongoDebugPanel'
,
)
)
# HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS defines, as dictionary of regex's, a set of mappings of HTTP request hostnames to
# HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS defines, as dictionary of regex's, a
# what the 'default' modulestore to use while processing the request
# set of mappings of HTTP request hostnames to what the 'default' modulestore
# for example 'preview.edx.org' should use the draft modulestore
# to use while processing the request.
# for example 'preview.edx.org' should use the draft modulestore.
HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS
=
{
HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS
=
{
'preview
\
.'
:
'draft-preferred'
r
'preview\.'
:
'draft-preferred'
}
}
This diff is collapsed.
Click to expand it.
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