Tests LayerMapping on inherited models. See #12093.
(self)
| 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." |
nothing calls this directly
no test coverage detected