diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-23 13:15:45 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-23 13:15:45 -0400 |
| commit | 859eeaa0f0b04c2644237ff04e6632b2f40475cb (patch) | |
| tree | f0db3c0bf0d872d40bfea60cd83fbb8c71fc4518 /tests | |
| parent | 669c29c8f4986def15cc4ee38b27299d32d5009f (diff) | |
Fixed #26533 -- Renamed Widget._format_value() to format_value().
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/field_tests/test_datefield.py | 8 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_input_formats.py | 144 |
2 files changed, 76 insertions, 76 deletions
diff --git a/tests/forms_tests/field_tests/test_datefield.py b/tests/forms_tests/field_tests/test_datefield.py index 75dda3425b..b23b5a42ce 100644 --- a/tests/forms_tests/field_tests/test_datefield.py +++ b/tests/forms_tests/field_tests/test_datefield.py @@ -69,7 +69,7 @@ class DateFieldTest(SimpleTestCase): 'mydate_year': '2008', 'mydate_month': '4', 'mydate_day': '1', - 'initial-mydate': HiddenInput()._format_value(date(2008, 4, 1)), + 'initial-mydate': HiddenInput().format_value(date(2008, 4, 1)), }, initial={'mydate': date(2008, 4, 1)}) self.assertFalse(b.has_changed()) @@ -77,7 +77,7 @@ class DateFieldTest(SimpleTestCase): 'mydate_year': '2008', 'mydate_month': '4', 'mydate_day': '22', - 'initial-mydate': HiddenInput()._format_value(date(2008, 4, 1)), + 'initial-mydate': HiddenInput().format_value(date(2008, 4, 1)), }, initial={'mydate': date(2008, 4, 1)}) self.assertTrue(b.has_changed()) @@ -85,7 +85,7 @@ class DateFieldTest(SimpleTestCase): 'mydate_year': '2008', 'mydate_month': '4', 'mydate_day': '22', - 'initial-mydate': HiddenInput()._format_value(date(2008, 4, 1)), + 'initial-mydate': HiddenInput().format_value(date(2008, 4, 1)), }, initial={'mydate': date(2008, 4, 22)}) self.assertTrue(b.has_changed()) @@ -93,7 +93,7 @@ class DateFieldTest(SimpleTestCase): 'mydate_year': '2008', 'mydate_month': '4', 'mydate_day': '22', - 'initial-mydate': HiddenInput()._format_value(date(2008, 4, 22)), + 'initial-mydate': HiddenInput().format_value(date(2008, 4, 22)), }, initial={'mydate': date(2008, 4, 1)}) self.assertFalse(b.has_changed()) diff --git a/tests/forms_tests/tests/test_input_formats.py b/tests/forms_tests/tests/test_input_formats.py index 51118a1470..d0f7fac45a 100644 --- a/tests/forms_tests/tests/test_input_formats.py +++ b/tests/forms_tests/tests/test_input_formats.py @@ -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") |
