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
327f7499
Commit
327f7499
authored
Aug 13, 2017
by
Brad Melin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple test to increase coverage and ensure that the required keys are always returned
parent
4c5efa34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
problem_builder/tests/unit/test_problem_builder.py
+15
-0
No files found.
problem_builder/tests/unit/test_problem_builder.py
View file @
327f7499
...
...
@@ -7,12 +7,27 @@ from random import random
from
xblock.field_data
import
DictFieldData
from
problem_builder.mcq
import
MCQBlock
from
problem_builder.mrq
import
MRQBlock
from
problem_builder.mentoring
import
MentoringBlock
,
MentoringMessageBlock
,
_default_options_config
from
.utils
import
BlockWithChildrenTestMixin
@ddt.ddt
class
TestMRQBlock
(
BlockWithChildrenTestMixin
,
unittest
.
TestCase
):
def
test_student_view_data
(
self
):
"""
Ensure that all expected fields are always returned.
"""
block
=
MRQBlock
(
Mock
(),
DictFieldData
({}),
Mock
())
self
.
assertListEqual
(
block
.
student_view_data
()
.
keys
(),
[
'hide_results'
,
'tips'
,
'weight'
,
'title'
,
'question'
,
'message'
,
'type'
,
'id'
,
'choices'
])
@ddt.ddt
class
TestMentoringBlock
(
BlockWithChildrenTestMixin
,
unittest
.
TestCase
):
def
test_sends_progress_event_when_rendered_student_view_with_display_submit_false
(
self
):
block
=
MentoringBlock
(
MagicMock
(),
DictFieldData
({
...
...
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