Refactoring test_float_field

This commit is contained in:
reverend 2020-09-13 13:30:47 +02:00
parent 470e54da8d
commit 09eb8794b8
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ class ModelTestCase:
)
)
def _test_float_field(self, field_name, min_value=None, max_value=None, must_have={}, must_hot_have={}):
def assertFloatField(self, field_name, min_value=None, max_value=None, must_have={}, must_hot_have={}):
'''
Tests if the field is a floatfield. If min_value and/or max_value are passed,
the validators of the field are also checked. The validator list of the field should

View File

@ -30,14 +30,14 @@ class MapablePointTestCase(ModelTestCase, TestCase):
)
def test_latitude(self):
self._test_float_field(
self.assertFloatField(
field_name='latitude',
min_value=-90,
max_value=90
)
def test_longitude(self):
self._test_float_field(
self.assertFloatField(
field_name='longitude',
min_value=-180,
max_value=180