Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
07586e6d
Commit
07586e6d
authored
Sep 03, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend integration test to make sure table block tries to translate URLs
in column headers.
parent
b232a70d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
problem_builder/tests/integration/test_table.py
+15
-0
problem_builder/tests/integration/xml/table_3.xml
+9
-0
No files found.
problem_builder/tests/integration/test_table.py
View file @
07586e6d
...
...
@@ -20,6 +20,8 @@
# Imports ###########################################################
from
mock
import
patch
from
workbench.runtime
import
WorkbenchRuntime
from
.base_test
import
MentoringBaseTest
...
...
@@ -54,3 +56,16 @@ class MentoringTableBlockTest(MentoringBaseTest):
self
.
assertEqual
(
len
(
rows
),
2
)
self
.
assertEqual
(
rows
[
0
]
.
text
,
'This is the answer #1'
)
self
.
assertEqual
(
rows
[
1
]
.
text
,
'This is the answer #2'
)
# Ensure that table block makes an effort to translate URLs in column headers
link_template
=
"<a href='http://www.test.com'>{}</a> in a column header."
original_contents
=
link_template
.
format
(
'Link'
)
updated_contents
=
link_template
.
format
(
'Updated link'
)
with
patch
.
object
(
WorkbenchRuntime
,
'replace_jump_to_id_urls'
,
create
=
True
)
as
patched_method
:
patched_method
.
return_value
=
updated_contents
table
=
self
.
go_to_page
(
'Table 3'
,
css_selector
=
'.mentoring-table'
)
patched_method
.
assert_called_once_with
(
original_contents
)
link
=
table
.
find_element_by_css_selector
(
'a'
)
self
.
assertEquals
(
link
.
text
,
'Updated link'
)
problem_builder/tests/integration/xml/table_3.xml
0 → 100644
View file @
07586e6d
<vertical_demo>
<problem-builder
display_submit=
"false"
enforce_dependency=
"false"
>
<pb-table>
<pb-column
header=
"<a href='http://www.test.com'>Link</a> in a column header."
>
<pb-answer-recap
name=
"table_3_answer_1"
/>
</pb-column>
</pb-table>
</problem-builder>
</vertical_demo>
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