diff --git a/tests/gis_tests/inspectapp/tests.py b/tests/gis_tests/inspectapp/tests.py index 51bb363fa0..ca49fc0d2d 100644 --- a/tests/gis_tests/inspectapp/tests.py +++ b/tests/gis_tests/inspectapp/tests.py @@ -134,12 +134,20 @@ class OGRInspectTest(TestCase): )) # The ordering of model fields might vary depending on several factors (version of GDAL, etc.) - self.assertIn(' f_decimal = models.DecimalField(max_digits=0, decimal_places=0)', model_def) + if connection.vendor == 'sqlite': + # SpatiaLite introspection is somewhat lacking (#29461). + self.assertIn(' f_decimal = models.CharField(max_length=0)', model_def) + else: + self.assertIn(' f_decimal = models.DecimalField(max_digits=0, decimal_places=0)', model_def) self.assertIn(' f_int = models.IntegerField()', model_def) self.assertIn(' f_datetime = models.DateTimeField()', model_def) self.assertIn(' f_time = models.TimeField()', model_def) - self.assertIn(' f_float = models.FloatField()', model_def) - self.assertIn(' f_char = models.CharField(max_length=10)', model_def) + if connection.vendor == 'sqlite': + self.assertIn(' f_float = models.CharField(max_length=0)', model_def) + else: + self.assertIn(' f_float = models.FloatField()', model_def) + max_length = 0 if connection.vendor == 'sqlite' else 10 + self.assertIn(' f_char = models.CharField(max_length=%s)' % max_length, model_def) self.assertIn(' f_date = models.DateField()', model_def) # Some backends may have srid=-1