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
c4befa13
Commit
c4befa13
authored
Apr 08, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8
parent
f0d2ff7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
common/lib/xmodule/xmodule/tests/test_date_utils.py
+9
-4
No files found.
common/lib/xmodule/xmodule/tests/test_date_utils.py
View file @
c4befa13
...
...
@@ -5,6 +5,7 @@ from xmodule.util import date_utils
import
datetime
import
time
def
test_get_time_struct_display
():
assert_equals
(
""
,
date_utils
.
get_time_struct_display
(
None
,
""
))
test_time
=
time
.
struct_time
((
1992
,
3
,
12
,
15
,
3
,
30
,
1
,
71
,
0
))
...
...
@@ -15,16 +16,20 @@ def test_get_time_struct_display():
def
test_get_default_time_display
():
assert_equals
(
""
,
date_utils
.
get_default_time_display
(
None
))
test_time
=
time
.
struct_time
((
1992
,
3
,
12
,
15
,
3
,
30
,
1
,
71
,
0
))
assert_equals
(
"Mar 12, 1992 at 15:03 UTC"
,
assert_equals
(
"Mar 12, 1992 at 15:03 UTC"
,
date_utils
.
get_default_time_display
(
test_time
))
assert_equals
(
"Mar 12, 1992 at 15:03 UTC"
,
assert_equals
(
"Mar 12, 1992 at 15:03 UTC"
,
date_utils
.
get_default_time_display
(
test_time
,
True
))
assert_equals
(
"Mar 12, 1992 at 15:03"
,
assert_equals
(
"Mar 12, 1992 at 15:03"
,
date_utils
.
get_default_time_display
(
test_time
,
False
))
def
test_time_to_datetime
():
assert_equals
(
None
,
date_utils
.
time_to_datetime
(
None
))
test_time
=
time
.
struct_time
((
1992
,
3
,
12
,
15
,
3
,
30
,
1
,
71
,
0
))
assert_equals
(
datetime
.
datetime
(
1992
,
3
,
12
,
15
,
3
,
30
),
assert_equals
(
datetime
.
datetime
(
1992
,
3
,
12
,
15
,
3
,
30
),
date_utils
.
time_to_datetime
(
test_time
))
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