From 09eb8794b849bdb292c573f4b6903068f8b81231 Mon Sep 17 00:00:00 2001 From: reverend Date: Sun, 13 Sep 2020 13:30:47 +0200 Subject: [PATCH] Refactoring test_float_field --- lostplaces/lostplaces_app/tests/models/__init__.py | 2 +- .../lostplaces_app/tests/models/test_abstract_models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lostplaces/lostplaces_app/tests/models/__init__.py b/lostplaces/lostplaces_app/tests/models/__init__.py index 17b12ed..ffb9832 100644 --- a/lostplaces/lostplaces_app/tests/models/__init__.py +++ b/lostplaces/lostplaces_app/tests/models/__init__.py @@ -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 diff --git a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py index 42bcc31..fa023d7 100644 --- a/lostplaces/lostplaces_app/tests/models/test_abstract_models.py +++ b/lostplaces/lostplaces_app/tests/models/test_abstract_models.py @@ -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