Commit 01d10932 authored by Jérome Perrin's avatar Jérome Perrin

testDateUtils: run some original DateTime tests with our patches loaded

This ensures that we don't break more.
parent ba286114
...@@ -309,4 +309,35 @@ def test_suite(): ...@@ -309,4 +309,35 @@ def test_suite():
suite.addTest(unittest.makeSuite(TestPinDateTime)) suite.addTest(unittest.makeSuite(TestPinDateTime))
suite.addTest(unittest.makeSuite(TestTimeZoneContext)) suite.addTest(unittest.makeSuite(TestTimeZoneContext))
suite.addTest(unittest.makeSuite(TestDateTimePatch)) suite.addTest(unittest.makeSuite(TestDateTimePatch))
# also run original tests from DateTime module
# pylint:disable=no-name-in-module
try:
import DateTime.tests.testDateTime as test_datetime
except ImportError:
from DateTime.tests import test_datetime
# pylint:enable=no-name-in-module
class DateTimeTests(test_datetime.DateTimeTests):
testTimezoneNaiveHandling = unittest.expectedFailure(
test_datetime.DateTimeTests.testTimezoneNaiveHandling)
# This test is only in DateTime >= 3
if hasattr(test_datetime.DateTimeTests, 'test_intl_format_hyphen'):
test_intl_format_hyphen = unittest.expectedFailure(
test_datetime.DateTimeTests.test_intl_format_hyphen)
# These 3 tests are only in DateTime 2
if hasattr(test_datetime.DateTimeTests, 'test_pickle_new_with_micros'):
test_pickle_new_with_micros = unittest.expectedFailure(
test_datetime.DateTimeTests.test_pickle_new_with_micros)
if hasattr(test_datetime.DateTimeTests, 'test_pickle_new_with_tz'):
test_pickle_new_with_tz = unittest.expectedFailure(
test_datetime.DateTimeTests.test_pickle_new_with_tz)
if hasattr(test_datetime.DateTimeTests, 'testLegacyTimezones'):
testLegacyTimezones = unittest.expectedFailure(
test_datetime.DateTimeTests.testLegacyTimezones)
suite.addTest(unittest.makeSuite(DateTimeTests))
return suite return suite
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