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
52c2f3ae
Commit
52c2f3ae
authored
Apr 17, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tested additional values of rerandomize (true/false/per_student)
Pylint fixes
parent
754d1eb7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
21 deletions
+14
-21
common/lib/capa/capa/tests/test_input_templates.py
+14
-21
common/lib/xmodule/xmodule/tests/test_capa_module.py
+0
-0
No files found.
common/lib/capa/capa/tests/test_input_templates.py
View file @
52c2f3ae
"""Tests for the logic in input type mako templates."""
#pylint: disable=R0904
import
unittest
import
capa
...
...
@@ -11,26 +10,22 @@ from mako.template import Template as MakoTemplate
class
TemplateTestCase
(
unittest
.
TestCase
):
"""Utilitites for testing templates"""
# Allow us to pass an extra arg to setUp to configure
# the test case. Also allow setUp as a valid method name.
#pylint: disable=W0221
#pylint: disable=C0103
def
setUp
(
self
,
template_name
):
"""Load the template
`template_name` is the file name of the template
to be loaded from capa/templates.
The template name should include the .html extension:
for example: choicegroup.html
"""
# Subclasses override this to specify the file name of the template
# to be loaded from capa/templates.
# The template name should include the .html extension:
# for example: choicegroup.html
TEMPLATE_NAME
=
None
def
setUp
(
self
):
"""Load the template"""
capa_path
=
capa
.
__path__
[
0
]
self
.
template_path
=
os
.
path
.
join
(
capa_path
,
'templates'
,
template_name
)
self
.
template_path
=
os
.
path
.
join
(
capa_path
,
'templates'
,
self
.
TEMPLATE_NAME
)
template_file
=
open
(
self
.
template_path
)
self
.
template
=
MakoTemplate
(
template_file
.
read
())
template_file
.
close
()
# Allow us to pass **context_dict to render_unicode()
#pylint: disable=W0142
def
render_to_xml
(
self
,
context_dict
):
"""Render the template using the `context_dict` dict.
...
...
@@ -65,10 +60,8 @@ class TemplateTestCase(unittest.TestCase):
class
TestChoiceGroupTemplate
(
TemplateTestCase
):
"""Test mako template for `<choicegroup>` input"""
# Allow us to pass an extra arg to setUp to configure
# the test case. Also allow setUp as a valid method name.
#pylint: disable=W0221
#pylint: disable=C0103
TEMPLATE_NAME
=
'choicegroup.html'
def
setUp
(
self
):
choices
=
[(
'1'
,
'choice 1'
),
(
'2'
,
'choice 2'
),
(
'3'
,
'choice 3'
)]
self
.
context
=
{
'id'
:
'1'
,
...
...
@@ -77,7 +70,7 @@ class TestChoiceGroupTemplate(TemplateTestCase):
'input_type'
:
'checkbox'
,
'name_array_suffix'
:
'1'
,
'value'
:
'3'
}
super
(
TestChoiceGroupTemplate
,
self
)
.
setUp
(
'choicegroup.html'
)
super
(
TestChoiceGroupTemplate
,
self
)
.
setUp
()
def
test_problem_marked_correct
(
self
):
"""Test conditions under which the entire problem
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
52c2f3ae
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