@@ -23,6 +23,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
2323 has_case_insensitive_like = False
2424 # https://cloud.google.com/spanner/quotas#query_limits
2525 max_query_params = 900
26+ # Spanner does not support parameterized defaults in DDL
27+ requires_literal_defaults = True
28+
2629 if os .environ .get ("RUNNING_SPANNER_BACKEND_TESTS" ) == "1" :
2730 supports_foreign_keys = False
2831 else :
@@ -62,6 +65,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
6265
6366 # Django tests that aren't supported by Spanner.
6467 skip_tests = (
68+ # AutoFields are assigned a random value on instantiation in this backend.
69+ "empty.tests.EmptyModelTests.test_empty" ,
70+ "many_to_one_null.tests.ManyToOneNullTests.test_unsaved" ,
6571 # Spanner does not support very long FK name: 400 Foreign Key name not valid
6672 "backends.tests.FkConstraintsTests.test_check_constraints" ,
6773 # No foreign key ON DELETE CASCADE in Spanner.
@@ -72,6 +78,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
7278 "basic.tests.SelectOnSaveTests.test_select_on_save_lying_update" ,
7379 # django_spanner monkey patches AutoField to have a default value.
7480 "basic.tests.ModelTest.test_hash" ,
81+ # view_tests.tests.test_defaults.DefaultsTests fails with IntegrityError (Site ID collision)
82+ "view_tests.tests.test_defaults.DefaultsTests" ,
7583 "custom_managers.tests.CustomManagerTests.test_slow_removal_through_specified_fk_related_manager" ,
7684 "custom_managers.tests.CustomManagerTests.test_slow_removal_through_default_fk_related_manager" ,
7785 "generic_relations.test_forms.GenericInlineFormsetTests.test_options" ,
@@ -398,12 +406,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
398406 # Spanner does not support deferred unique constraints
399407 "migrations.test_operations.OperationTests.test_create_model_with_deferred_unique_constraint" ,
400408 # Spanner does not support JSON object query on fields.
401- "db_functions.comparison.test_json_object.JSONObjectTests.test_empty" ,
402- "db_functions.comparison.test_json_object.JSONObjectTests.test_basic" ,
403- "db_functions.comparison.test_json_object.JSONObjectTests.test_expressions" ,
404- "db_functions.comparison.test_json_object.JSONObjectTests.test_nested_empty_json_object" ,
405- "db_functions.comparison.test_json_object.JSONObjectTests.test_nested_json_object" ,
406- "db_functions.comparison.test_json_object.JSONObjectTests.test_textfield" ,
409+
407410 # Spanner does not support iso_week_day but week_day is supported.
408411 "timezones.tests.LegacyDatabaseTests.test_query_datetime_lookups" ,
409412 "timezones.tests.NewDatabaseTests.test_query_datetime_lookups" ,
@@ -1781,15 +1784,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
17811784 "sitemaps_tests.test_https.HTTPSDetectionSitemapTests.test_sitemap_section_with_https_request" , # noqa
17821785 "sitemaps_tests.test_https.HTTPSSitemapTests.test_secure_sitemap_index" , # noqa
17831786 "sitemaps_tests.test_https.HTTPSSitemapTests.test_secure_sitemap_section" , # noqa
1784- "sitemaps_tests.test_management.PingGoogleTests.test_args" , # noqa
1785- "sitemaps_tests.test_management.PingGoogleTests.test_default" , # noqa
1786- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_exact_url" , # noqa
1787- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_global" , # noqa
1788- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_index" , # noqa
1789- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_insecure" , # noqa
1790- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_no_sites" , # noqa
1791- "sitemaps_tests.test_utils.PingGoogleTests.test_get_sitemap_full_url_not_detected" , # noqa
1792- "sitemaps_tests.test_utils.PingGoogleTests.test_something" , # noqa
1787+
1788+
17931789 "string_lookup.tests.StringLookupTests.test_queries_on_textfields" , # noqa
17941790 "force_insert_update.tests.InheritanceTests.test_force_update_on_inherited_model_without_fields" , # noqa
17951791 "force_insert_update.tests.InheritanceTests.test_force_update_on_inherited_model" , # noqa
0 commit comments