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
3831f381
Commit
3831f381
authored
Aug 15, 2017
by
Braden MacDonald
Committed by
GitHub
Aug 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #159 from open-craft/bradmerlin/mrq-student_view_data-tests
Add simple test for MRQ student_view_data
parents
e338c740
327f7499
Hide 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 @
3831f381
...
@@ -7,12 +7,27 @@ from random import random
...
@@ -7,12 +7,27 @@ from random import random
from
xblock.field_data
import
DictFieldData
from
xblock.field_data
import
DictFieldData
from
problem_builder.mcq
import
MCQBlock
from
problem_builder.mcq
import
MCQBlock
from
problem_builder.mrq
import
MRQBlock
from
problem_builder.mentoring
import
MentoringBlock
,
MentoringMessageBlock
,
_default_options_config
from
problem_builder.mentoring
import
MentoringBlock
,
MentoringMessageBlock
,
_default_options_config
from
.utils
import
BlockWithChildrenTestMixin
from
.utils
import
BlockWithChildrenTestMixin
@ddt.ddt
@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
):
class
TestMentoringBlock
(
BlockWithChildrenTestMixin
,
unittest
.
TestCase
):
def
test_sends_progress_event_when_rendered_student_view_with_display_submit_false
(
self
):
def
test_sends_progress_event_when_rendered_student_view_with_display_submit_false
(
self
):
block
=
MentoringBlock
(
MagicMock
(),
DictFieldData
({
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