Cast geography fields to geometry type when validating uniqueness to remove the reliance on unavailable ~= operator.
(self)
| 43 | |
| 44 | @skipUnlessDBFeature("supports_geography", "supports_geometry_field_unique_index") |
| 45 | def test_geography_unique(self): |
| 46 | """ |
| 47 | Cast geography fields to geometry type when validating uniqueness to |
| 48 | remove the reliance on unavailable ~= operator. |
| 49 | """ |
| 50 | htown = City.objects.get(name="Houston") |
| 51 | CityUnique.objects.create(point=htown.point) |
| 52 | duplicate = CityUnique(point=htown.point) |
| 53 | msg = "City unique with this Point already exists." |
| 54 | with self.assertRaisesMessage(ValidationError, msg): |
| 55 | duplicate.validate_unique() |
| 56 | |
| 57 | @skipUnlessDBFeature("supports_geography") |
| 58 | def test_operators_functions_unavailable_for_geography(self): |
nothing calls this directly
no test coverage detected