diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index e3a8e85567..b24d6b412f 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -1544,12 +1544,6 @@ class DecimalField(Field): params={'value': value}, ) - def _format(self, value): - if isinstance(value, str): - return value - else: - return self.format_number(value) - def format_number(self, value): """ Format a number into a string with the requisite number of digits and diff --git a/tests/model_fields/test_decimalfield.py b/tests/model_fields/test_decimalfield.py index 5163d8188b..17bbae7ffa 100644 --- a/tests/model_fields/test_decimalfield.py +++ b/tests/model_fields/test_decimalfield.py @@ -28,12 +28,6 @@ class DecimalFieldTests(TestCase): f = models.DecimalField(default=Decimal('0.00')) self.assertEqual(f.get_default(), Decimal('0.00')) - def test_format(self): - f = models.DecimalField(max_digits=5, decimal_places=1) - self.assertEqual(f._format(f.to_python(2)), '2.0') - self.assertEqual(f._format(f.to_python('2.6')), '2.6') - self.assertIsNone(f._format(None)) - def test_get_prep_value(self): f = models.DecimalField(max_digits=5, decimal_places=1) self.assertIsNone(f.get_prep_value(None))