Removed unused models.DecimalField._format().

Unused since b3b71a0922.
This commit is contained in:
Sergey Fedoseev 2017-07-20 18:00:18 +05:00 committed by Tim Graham
parent 81a453ca0f
commit 37fbeb99f9
2 changed files with 0 additions and 12 deletions

View File

@ -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

View File

@ -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))