Permalink
Browse files

Update tests to not expect None date/times.

  • Loading branch information...
1 parent c29d335 commit eb22d12802cbf2397a39c46efbc36f25cebc3551 @mythmon committed Feb 1, 2012
Showing with 14 additions and 6 deletions.
  1. +14 −6 wok/tests/test_util.py
View
@@ -43,7 +43,7 @@ def test_apostrophes(self):
slug = u'dont-use-bobs-stuff'
self.assertEqual(slug, util.slugify(orig))
- test_apostrophes.todo = "Apostrophes are treated like normal words right now"
+ test_apostrophes.todo = "Apostrophes are treated like normal words."
class TestDatetimes(TestCase):
@@ -53,15 +53,19 @@ def setUp(self):
The datetime is the first commit of wok.
The date is the day this test was first written.
- The time is pi second, in GMT-8.
+ The time is pi second.
"""
self.datetime = datetime(2011, 2, 3, 0, 23, 0, 0)
self.date = date(2011, 10, 12)
self.time = time(3, 14, 15, 0)
def test_blanks(self):
inp = {}
- out = {'datetime': None, 'date': None, 'time': None, }
+ out = {
+ 'datetime': datetime(1970, 1, 1),
+ 'date': date(1970, 1, 1),
+ 'time': time(),
+ }
util.date_and_times(inp)
self.assertEquals(inp, out)
@@ -71,15 +75,19 @@ def test_just_date(self):
out = {
'datetime': datetime(2011, 10, 12, 0, 0, 0, 0),
'date': self.date,
- 'time': None,
+ 'time': time(),
}
util.date_and_times(inp)
self.assertEquals(inp, out)
def test_just_time(self):
inp = {'time': self.time}
- out = {'datetime': None, 'date': None, 'time': self.time, }
+ out = {
+ 'datetime': datetime(1970, 1, 1),
+ 'date': date(1970, 1, 1),
+ 'time': self.time,
+ }
util.date_and_times(inp)
self.assertEquals(inp, out)
@@ -148,7 +156,7 @@ def test_types(self):
out = {
'datetime': datetime(2011, 12, 25),
'date': date(2011, 12, 25),
- 'time': None,
+ 'time': time(),
}
util.date_and_times(inp)

0 comments on commit eb22d12

Please sign in to comment.