MCPcopy
hub / github.com/django/django / test_model_inheritance

Method test_model_inheritance

tests/gis_tests/layermap/tests.py:299–317  ·  view source on GitHub ↗

Tests LayerMapping on inherited models. See #12093.

(self)

Source from the content-addressed store, hash-verified

297 self.county_helper(county_feat=False)
298
299 def test_model_inheritance(self):
300 "Tests LayerMapping on inherited models. See #12093."
301 icity_mapping = {
302 "name": "Name",
303 "population": "Population",
304 "density": "Density",
305 "point": "POINT",
306 "dt": "Created",
307 }
308 # Parent model has geometry field.
309 lm1 = LayerMapping(ICity1, city_shp, icity_mapping)
310 lm1.save()
311
312 # Grandparent has geometry field.
313 lm2 = LayerMapping(ICity2, city_shp, icity_mapping)
314 lm2.save()
315
316 self.assertEqual(6, ICity1.objects.count())
317 self.assertEqual(3, ICity2.objects.count())
318
319 def test_invalid_layer(self):
320 "Tests LayerMapping on invalid geometries. See #15378."

Callers

nothing calls this directly

Calls 3

saveMethod · 0.95
LayerMappingClass · 0.90
countMethod · 0.45

Tested by

no test coverage detected