Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
1e4fac64
Commit
1e4fac64
authored
5 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Patches
Plain Diff
Better tests of stringifying objects. BOM-730 and BOM-731
parent
f68c7e87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/coursegraph/management/commands/tests/test_dump_to_neo4j.py
+9
-3
9 additions, 3 deletions
...ursegraph/management/commands/tests/test_dump_to_neo4j.py
with
9 additions
and
3 deletions
openedx/core/djangoapps/coursegraph/management/commands/tests/test_dump_to_neo4j.py
+
9
−
3
View file @
1e4fac64
...
...
@@ -10,7 +10,6 @@ import ddt
import
mock
import
six
from
django.core.management
import
call_command
from
django.utils
import
six
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
...
...
@@ -230,6 +229,12 @@ class TestDumpToNeo4jCommand(TestDumpToNeo4jCommandBase):
)
class
SomeThing
(
object
):
"""
Just to test the stringification of an object.
"""
def
__str__
(
self
):
return
"
<SomeThing>
"
@skip_unless_lms
@ddt.ddt
class
TestModuleStoreSerializer
(
TestDumpToNeo4jCommandBase
):
...
...
@@ -379,7 +384,7 @@ class TestModuleStoreSerializer(TestDumpToNeo4jCommandBase):
@ddt.data
(
(
1
,
1
),
(
object
,
"
<type
'
object
'
>
"
),
(
SomeThing
(),
"
<SomeThing
>
"
),
(
1.5
,
1.5
),
(
"
úñîçø∂é
"
,
"
úñîçø∂é
"
),
(
b
"
plain string
"
,
b
"
plain string
"
),
...
...
@@ -388,7 +393,8 @@ class TestModuleStoreSerializer(TestDumpToNeo4jCommandBase):
((
1
,),
"
(1,)
"
),
# list of elements should be coerced into a list of the
# string representations of those elements
([
object
,
object
],
[
"
<type
'
object
'
>
"
,
"
<type
'
object
'
>
"
])
([
SomeThing
(),
SomeThing
()],
[
"
<SomeThing>
"
,
"
<SomeThing>
"
]),
([
1
,
2
],
[
"
1
"
,
"
2
"
]),
)
@ddt.unpack
def
test_coerce_types
(
self
,
original_value
,
coerced_expected
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment