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
ece4cb66
Commit
ece4cb66
authored
Oct 21, 2013
by
Alexander Kryklia
Committed by
polesye
Oct 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for IsoTime
parent
ed97000d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
+23
-1
common/lib/xmodule/xmodule/tests/test_xml_module.py
+23
-1
No files found.
common/lib/xmodule/xmodule/tests/test_xml_module.py
View file @
ece4cb66
...
...
@@ -10,7 +10,7 @@ from xblock.field_data import DictFieldData
from
xblock.fields
import
Scope
,
String
,
Dict
,
Boolean
,
Integer
,
Float
,
Any
,
List
from
xblock.runtime
import
DbModel
from
xmodule.fields
import
Date
,
Timedelta
from
xmodule.fields
import
Date
,
Timedelta
,
IsoTime
from
xmodule.modulestore.inheritance
import
InheritanceKeyValueStore
,
InheritanceMixin
from
xmodule.xml_module
import
XmlDescriptor
,
serialize_field
,
deserialize_field
from
xmodule.course_module
import
CourseDescriptor
...
...
@@ -389,6 +389,28 @@ class TestDeserializeTimedelta(TestDeserialize):
self
.
assertDeserializeNonString
()
class
TestDeserializeIsoTime
(
TestDeserialize
):
""" Tests deserialize as related to Timedelta type. """
test_field
=
IsoTime
def
test_deserialize
(
self
):
"""
There is nono check for
self.assertDeserializeEqual('10:20:30', '10:20:30')
self.assertDeserializeNonString()
because these two tests work only because json.loads fires exception,
and xml_module.deserialized_field catches it and returns same value
so there is nothing field-specific here.
But othere modules do it, so I'm leaving this comment for PR reviewers.
"""
# test that from_json produces no exceptions
self
.
assertDeserializeEqual
(
'10:20:30'
,
'"10:20:30"'
)
class
TestXmlAttributes
(
XModuleXmlImportTest
):
def
test_unknown_attribute
(
self
):
...
...
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