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
7dced20b
Commit
7dced20b
authored
Aug 07, 2017
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests broken due to "components" converted to dictionary
parent
f79b231d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
problem_builder/tests/unit/test_mixins.py
+5
-5
No files found.
problem_builder/tests/unit/test_mixins.py
View file @
7dced20b
...
@@ -100,7 +100,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
...
@@ -100,7 +100,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
block
=
self
.
_build_block
(
XBlockChildrenNoUserState
,
{
"scope_settings"
:
"qwe"
,
"scope_content"
:
"ASD"
})
block
=
self
.
_build_block
(
XBlockChildrenNoUserState
,
{
"scope_settings"
:
"qwe"
,
"scope_content"
:
"ASD"
})
self
.
assertEqual
(
block
.
children
,
[])
# precondition
self
.
assertEqual
(
block
.
children
,
[])
# precondition
self
.
assertEqual
(
block
.
build_user_state_data
(),
{
"components"
:
[]
})
self
.
assertEqual
(
block
.
build_user_state_data
(),
{
"components"
:
{}
})
def
test_children_no_user_state
(
self
):
def
test_children_no_user_state
(
self
):
block
=
self
.
_build_block
(
XBlockChildrenNoUserState
,
{
"scope_settings"
:
"qwe"
,
"scope_content"
:
"ASD"
})
block
=
self
.
_build_block
(
XBlockChildrenNoUserState
,
{
"scope_settings"
:
"qwe"
,
"scope_content"
:
"ASD"
})
...
@@ -116,7 +116,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
...
@@ -116,7 +116,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
student_user_state
=
block
.
build_user_state_data
()
student_user_state
=
block
.
build_user_state_data
()
expected
=
{
"components"
:
[{},
{}]
}
expected
=
{
"components"
:
{
"child1"
:
{},
"child2"
:
{}}
}
self
.
assertEqual
(
student_user_state
,
expected
)
self
.
assertEqual
(
student_user_state
,
expected
)
def
test_children_with_user_state
(
self
):
def
test_children_with_user_state
(
self
):
...
@@ -151,7 +151,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
...
@@ -151,7 +151,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
student_user_state
=
block
.
build_user_state_data
()
student_user_state
=
block
.
build_user_state_data
()
expected
=
{
"components"
:
[
user_fields1
,
user_fields2
]
}
expected
=
{
"components"
:
{
"child1"
:
user_fields1
,
"child2"
:
user_fields2
}
}
self
.
assertEqual
(
student_user_state
,
expected
)
self
.
assertEqual
(
student_user_state
,
expected
)
def
test_user_state_at_parent_and_children
(
self
):
def
test_user_state_at_parent_and_children
(
self
):
...
@@ -187,7 +187,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
...
@@ -187,7 +187,7 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
student_user_state
=
block
.
build_user_state_data
()
student_user_state
=
block
.
build_user_state_data
()
expected
=
user_fields
.
copy
()
expected
=
user_fields
.
copy
()
expected
[
"components"
]
=
[
nested_user_fields
]
expected
[
"components"
]
=
{
"child1"
:
nested_user_fields
}
self
.
assertEqual
(
student_user_state
,
expected
)
self
.
assertEqual
(
student_user_state
,
expected
)
def
test_user_state_handler
(
self
):
def
test_user_state_handler
(
self
):
...
@@ -227,5 +227,5 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
...
@@ -227,5 +227,5 @@ class TestStudentViewUserStateMixin(unittest.TestCase):
expected
[
"user_info_2"
]
=
expected
[
"user_info_2"
]
.
isoformat
()
expected
[
"user_info_2"
]
=
expected
[
"user_info_2"
]
.
isoformat
()
nested_copy
=
nested_user_fields
.
copy
()
nested_copy
=
nested_user_fields
.
copy
()
nested_copy
[
"user_info_2"
]
=
nested_copy
[
"user_info_2"
]
.
isoformat
()
nested_copy
[
"user_info_2"
]
=
nested_copy
[
"user_info_2"
]
.
isoformat
()
expected
[
"components"
]
=
[
nested_copy
]
expected
[
"components"
]
=
{
"child1"
:
nested_copy
}
self
.
assertEqual
(
student_user_state
,
expected
)
self
.
assertEqual
(
student_user_state
,
expected
)
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