Kaydet (Commit) 19c10caa authored tarafından Barry Warsaw's avatar Barry Warsaw

Add tests for bug #478115, parsedate_tz() IndexError when a Date:

field exists with an empty value.
üst 4a106ee9
...@@ -937,6 +937,9 @@ class TestMiscellaneous(unittest.TestCase): ...@@ -937,6 +937,9 @@ class TestMiscellaneous(unittest.TestCase):
toff = time.timezone toff = time.timezone
self.assertEqual(offset, toff) self.assertEqual(offset, toff)
def test_parsedate(self):
self.assertEqual(Utils.parsedate(''), None)
# Test the iterator/generators # Test the iterator/generators
......
...@@ -117,6 +117,14 @@ class MessageTestCase(unittest.TestCase): ...@@ -117,6 +117,14 @@ class MessageTestCase(unittest.TestCase):
('', 'goit@lip.com'), ('', 'goit@lip.com'),
]) ])
self.check(
'To: Some One <someone@dom.ain>\n'
'From: Anudder Persin <subuddy.else@dom.ain>\n'
'Date:\n'
'\n'
'test',
[('Some One', 'someone@dom.ain')])
self.check( self.check(
'To: person@dom.ain (User J. Person)\n\n', 'To: person@dom.ain (User J. Person)\n\n',
[('User J. Person', 'person@dom.ain')]) [('User J. Person', 'person@dom.ain')])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment