|
| 1 | +from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures |
| 2 | +from django.utils.functional import cached_property |
| 3 | + |
| 4 | +from django_mongodb_backend.features import DatabaseFeatures as MongoFeatures |
| 5 | + |
| 6 | + |
| 7 | +class DatabaseFeatures(BaseSpatialFeatures, MongoFeatures): |
| 8 | + has_spatialrefsys_table = False |
| 9 | + supports_transform = False |
| 10 | + |
| 11 | + @cached_property |
| 12 | + def django_test_expected_failures(self): |
| 13 | + expected_failures = super().django_test_expected_failures |
| 14 | + expected_failures.update( |
| 15 | + { |
| 16 | + # SRIDs aren't supported. |
| 17 | + "gis_tests.geogapp.tests.GeographyTest.test05_geography_layermapping", |
| 18 | + "gis_tests.geoapp.tests.GeoModelTest.test_proxy", |
| 19 | + # 'WithinLookup' object has no attribute 'as_mql' |
| 20 | + # "gis_tests.relatedapp.tests.RelatedGeoModelTest.test10_combine", |
| 21 | + # GEOSException: Calling transform() with no SRID set is not supported |
| 22 | + "gis_tests.relatedapp.tests.RelatedGeoModelTest.test06_f_expressions", |
| 23 | + # To triage: |
| 24 | + "gis_tests.geoapp.test_expressions.GeoExpressionsTests.test_geometry_value_annotation", |
| 25 | + "gis_tests.geoapp.test_expressions.GeoExpressionsTests.test_multiple_annotation", |
| 26 | + "gis_tests.geoapp.test_regress.GeoRegressionTests.test_empty_count", |
| 27 | + "gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_fields_option", |
| 28 | + "gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_geometry_field_option", |
| 29 | + "gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_id_field_option", |
| 30 | + "gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_serialization_base", |
| 31 | + "gis_tests.geoapp.test_serializers.GeoJSONSerializerTests.test_srid_option", |
| 32 | + "gis_tests.geoapp.tests.GeoLookupTest.test_contains_contained_lookups", |
| 33 | + "gis_tests.geoapp.tests.GeoLookupTest.test_disjoint_lookup", |
| 34 | + "gis_tests.geoapp.tests.GeoLookupTest.test_equals_lookups", |
| 35 | + "gis_tests.geoapp.tests.GeoLookupTest.test_null_geometries", |
| 36 | + "gis_tests.geoapp.tests.GeoLookupTest.test_subquery_annotation", |
| 37 | + "gis_tests.geoapp.tests.GeoModelTest.test_geometryfield", |
| 38 | + "gis_tests.geoapp.tests.GeoModelTest.test_gis_query_as_string", |
| 39 | + "gis_tests.geoapp.tests.GeoQuerySetTest.test_within_subquery", |
| 40 | + "gis_tests.geoapp.test_expressions.GeoExpressionsTests.test_update_from_other_field", |
| 41 | + # No lookups are supported (yet?) |
| 42 | + "gis_tests.geoapp.tests.GeoLookupTest.test_gis_lookups_with_complex_expressions", |
| 43 | + } |
| 44 | + ) |
| 45 | + return expected_failures |
| 46 | + |
| 47 | + @cached_property |
| 48 | + def django_test_skips(self): |
| 49 | + skips = super().django_test_skips |
| 50 | + skips.update( |
| 51 | + { |
| 52 | + "inspectdb not supported.": { |
| 53 | + "gis_tests.inspectapp.tests.InspectDbTests", |
| 54 | + }, |
| 55 | + "Raw SQL not supported": { |
| 56 | + "gis_tests.geoapp.tests.GeoModelTest.test_raw_sql_query", |
| 57 | + }, |
| 58 | + }, |
| 59 | + ) |
| 60 | + return skips |
0 commit comments