more test cov

This commit is contained in:
Bastien Gérard
2019-05-12 22:58:17 +02:00
parent f28e1b8c90
commit 00d2fd685a
9 changed files with 42 additions and 33 deletions

View File

@@ -40,6 +40,11 @@ class GeoFieldTest(unittest.TestCase):
expected = "Both values (%s) in point must be float or int" % repr(coord)
self._test_for_expected_error(Location, coord, expected)
invalid_coords = [21, 4, 'a']
for coord in invalid_coords:
expected = "GeoPointField can only accept tuples or lists of (x, y)"
self._test_for_expected_error(Location, coord, expected)
def test_point_validation(self):
class Location(Document):
loc = PointField()