|
|
|
@ -27,7 +27,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '13:30:05')
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid, but non-default format, get a parsed result
|
|
|
|
@ -35,7 +35,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
# ISO formats are accepted, even if not specified in formats.py
|
|
|
|
@ -54,7 +54,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '13:30:05')
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -62,7 +62,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_timeField_with_inputformat(self):
|
|
|
|
@ -79,7 +79,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -87,7 +87,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_timeField_with_inputformat(self):
|
|
|
|
@ -104,7 +104,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -112,7 +112,7 @@ class LocalizedTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -130,7 +130,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '01:30:05 PM')
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid, but non-default format, get a parsed result
|
|
|
|
@ -138,7 +138,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM")
|
|
|
|
|
|
|
|
|
|
def test_localized_timeField(self):
|
|
|
|
@ -153,7 +153,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '01:30:05 PM')
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -161,7 +161,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM")
|
|
|
|
|
|
|
|
|
|
def test_timeField_with_inputformat(self):
|
|
|
|
@ -178,7 +178,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:05 PM")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -186,7 +186,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM")
|
|
|
|
|
|
|
|
|
|
def test_localized_timeField_with_inputformat(self):
|
|
|
|
@ -203,7 +203,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:05 PM")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -211,7 +211,7 @@ class CustomTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -228,7 +228,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid, but non-default format, get a parsed result
|
|
|
|
@ -236,7 +236,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_timeField(self):
|
|
|
|
@ -251,7 +251,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -259,7 +259,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_timeField_with_inputformat(self):
|
|
|
|
@ -274,7 +274,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -282,7 +282,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_timeField_with_inputformat(self):
|
|
|
|
@ -297,7 +297,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a time in a valid format, get a parsed result
|
|
|
|
@ -305,7 +305,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, time(13, 30, 0))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "13:30:00")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -332,7 +332,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -340,7 +340,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField(self):
|
|
|
|
@ -355,7 +355,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -363,7 +363,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_dateField_with_inputformat(self):
|
|
|
|
@ -382,7 +382,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -390,7 +390,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField_with_inputformat(self):
|
|
|
|
@ -409,7 +409,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -417,7 +417,7 @@ class LocalizedDateTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -435,7 +435,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -443,7 +443,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField(self):
|
|
|
|
@ -458,7 +458,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -466,7 +466,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_dateField_with_inputformat(self):
|
|
|
|
@ -483,7 +483,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -491,7 +491,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField_with_inputformat(self):
|
|
|
|
@ -508,7 +508,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -516,7 +516,7 @@ class CustomDateInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -533,7 +533,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -541,7 +541,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField(self):
|
|
|
|
@ -556,7 +556,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -564,7 +564,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
def test_dateField_with_inputformat(self):
|
|
|
|
@ -579,7 +579,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -587,7 +587,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateField_with_inputformat(self):
|
|
|
|
@ -602,7 +602,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -610,7 +610,7 @@ class SimpleDateFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, date(2010, 12, 21))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -637,7 +637,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010 13:30:05')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -645,7 +645,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField(self):
|
|
|
|
@ -660,7 +660,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '21.12.2010 13:30:05')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -668,7 +668,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_dateTimeField_with_inputformat(self):
|
|
|
|
@ -687,7 +687,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -695,7 +695,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField_with_inputformat(self):
|
|
|
|
@ -714,7 +714,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -722,7 +722,7 @@ class LocalizedDateTimeTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "21.12.2010 13:30:00")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -740,7 +740,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '01:30:05 PM 21/12/2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -748,7 +748,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField(self):
|
|
|
|
@ -763,7 +763,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, '01:30:05 PM 21/12/2010')
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -771,7 +771,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
def test_dateTimeField_with_inputformat(self):
|
|
|
|
@ -788,7 +788,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:05 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -796,7 +796,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField_with_inputformat(self):
|
|
|
|
@ -813,7 +813,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:05 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -821,7 +821,7 @@ class CustomDateTimeInputFormatsTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "01:30:00 PM 21/12/2010")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -838,7 +838,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid, but non-default format, get a parsed result
|
|
|
|
@ -846,7 +846,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField(self):
|
|
|
|
@ -861,7 +861,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -869,7 +869,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
def test_dateTimeField_with_inputformat(self):
|
|
|
|
@ -884,7 +884,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -892,7 +892,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:00")
|
|
|
|
|
|
|
|
|
|
def test_localized_dateTimeField_with_inputformat(self):
|
|
|
|
@ -907,7 +907,7 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30, 5))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to the same format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:05")
|
|
|
|
|
|
|
|
|
|
# Parse a date in a valid format, get a parsed result
|
|
|
|
@ -915,5 +915,5 @@ class SimpleDateTimeFormatTests(SimpleTestCase):
|
|
|
|
|
self.assertEqual(result, datetime(2010, 12, 21, 13, 30))
|
|
|
|
|
|
|
|
|
|
# Check that the parsed result does a round trip to default format
|
|
|
|
|
text = f.widget._format_value(result)
|
|
|
|
|
text = f.widget.format_value(result)
|
|
|
|
|
self.assertEqual(text, "2010-12-21 13:30:00")
|
|
|
|
|