mirror of
https://github.com/django/django.git
synced 2025-05-14 02:46:29 +00:00
Removed unused models.DecimalField._format().
Unused since b3b71a0922334c70bbc646a4873010f808196671.
This commit is contained in:
parent
81a453ca0f
commit
37fbeb99f9
@ -1544,12 +1544,6 @@ class DecimalField(Field):
|
|||||||
params={'value': value},
|
params={'value': value},
|
||||||
)
|
)
|
||||||
|
|
||||||
def _format(self, value):
|
|
||||||
if isinstance(value, str):
|
|
||||||
return value
|
|
||||||
else:
|
|
||||||
return self.format_number(value)
|
|
||||||
|
|
||||||
def format_number(self, value):
|
def format_number(self, value):
|
||||||
"""
|
"""
|
||||||
Format a number into a string with the requisite number of digits and
|
Format a number into a string with the requisite number of digits and
|
||||||
|
@ -28,12 +28,6 @@ class DecimalFieldTests(TestCase):
|
|||||||
f = models.DecimalField(default=Decimal('0.00'))
|
f = models.DecimalField(default=Decimal('0.00'))
|
||||||
self.assertEqual(f.get_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):
|
def test_get_prep_value(self):
|
||||||
f = models.DecimalField(max_digits=5, decimal_places=1)
|
f = models.DecimalField(max_digits=5, decimal_places=1)
|
||||||
self.assertIsNone(f.get_prep_value(None))
|
self.assertIsNone(f.get_prep_value(None))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user