From 37fbeb99f9cb834dda9a1a753af0a832f2bc5f7e Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 20 Jul 2017 18:00:18 +0500 Subject: [PATCH] Removed unused models.DecimalField._format(). Unused since b3b71a0922334c70bbc646a4873010f808196671. --- django/db/models/fields/__init__.py | 6 ------ tests/model_fields/test_decimalfield.py | 6 ------ 2 files changed, 12 deletions(-) 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))