Repository: googleapis/python-spanner-django

Issue:
django-test-suite: migrations test failures
When running the Django test suite for migrations, we get 11 errors

- [ ] test_migrate_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests)
- [ ] setUpClass (migrations.test_loader.RecorderTests)
- [ ] setUpClass (migrations.test_commands.MakeMigrationsTests)
- [ ] setUpClass (migrations.test_commands.MigrateTests)
- [ ] setUpClass (migrations.test_commands.SquashMigrationsTests)
- [ ] setUpClass (migrations.test_deprecated_fields.Tests)
- [ ] setUpClass (migrations.test_executor.ExecutorTests)
- [ ] setUpClass (migrations.test_loader.PycLoaderTests)
- [ ] setUpClass (migrations.test_multidb.MultiDBOperationTests)
- [ ] setUpClass (migrations.test_operations.OperationTests)
- [ ] setUpClass (migrations.test_operations.SwappableOperationTests)

with the failure log below
```shell
======================================================================
ERROR: test_migrate_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 565, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.ALREADY_EXISTS
	details = "Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission."
	debug_error_string = "{"created":"@1575450661.936621000","description":"Error received from peer ipv4:172.217.11.170:443","file":"src/core/lib/surface/call.cc","file_line":1046,"grpc_message":"Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.","grpc_status":6}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 94, in execute
    args if args else None,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/session.py", line 312, in run_in_transaction
    txn.commit()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/transaction.py", line 127, in commit
    metadata=metadata,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/gapic/spanner_client.py", line 1559, in commit
    request, retry=retry, timeout=timeout, metadata=metadata
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
    return wrapped_func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/retry.py", line 277, in retry_wrapped_func
    on_error=on_error,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/retry.py", line 182, in retry_target
    return target()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
    return func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.AlreadyExists: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 104, in execute
    raise IntegrityError(e.details if hasattr(e, 'details') else e)
spanner.dbapi.exceptions.IntegrityError: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 274, in __call__
    self._post_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1009, in _post_teardown
    self._fixture_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1173, in _fixture_teardown
    return super()._fixture_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1044, in _fixture_teardown
    inhibit_post_migrate=inhibit_post_migrate)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/__init__.py", line 148, in call_command
    return command.execute(*args, **defaults)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/commands/flush.py", line 80, in handle
    emit_post_migrate_signal(verbosity, interactive, database)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/sql.py", line 51, in emit_post_migrate_signal
    **kwargs
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/dispatch/dispatcher.py", line 175, in send
    for receiver in self._live_receivers(sender)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/dispatch/dispatcher.py", line 175, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/contrib/auth/management/__init__.py", line 83, in create_permissions
    Permission.objects.using(using).bulk_create(perms)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 468, in bulk_create
    self._batched_insert(objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 1211, in _batched_insert
    self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 1186, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/sql/compiler.py", line 1335, in execute_sql
    cursor.execute(sql, params)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 104, in execute
    raise IntegrityError(e.details if hasattr(e, 'details') else e)
django.db.utils.IntegrityError: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

======================================================================
ERROR: setUpClass (migrations.test_loader.RecorderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1123, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_loader.RecorderTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.MakeMigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.MakeMigrationsTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.MigrateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.MigrateTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.SquashMigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.SquashMigrationsTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_deprecated_fields.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_deprecated_fields.Tests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_executor.ExecutorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_executor.ExecutorTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_loader.PycLoaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_loader.PycLoaderTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_multidb.MultiDBOperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_multidb.MultiDBOperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_operations.OperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_operations.SwappableOperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_operations.SwappableOperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
FAIL: test_loading_squashed (migrations.test_loader.LoaderTests)
Tests loading a squashed migration
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/utils.py", line 373, in inner
    return func(*args, **kwargs)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_loader.py", line 255, in test_loading_squashed
    2,
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 313 tests in 790.759s

FAILED (failures=1, errors=11)
Preserving test database for alias 'default' ('db1')...
```

and then the full log is down below

<details>

```shell
System check identified no issues (0 silenced).
test_add_alter_order_with_respect_to (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_blank_textfield_and_charfield (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_constraints (migrations.test_autodetector.AutodetectorTests)
Test change detection of new constraints. ... ok
test_add_date_fields_with_auto_now_add_asking_for_default (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_date_fields_with_auto_now_add_not_asking_for_null_addition (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_date_fields_with_auto_now_not_asking_for_default (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_field (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of new fields. ... ok
test_add_field_and_foo_together (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_field_with_default (migrations.test_autodetector.AutodetectorTests)
#22030 - Adding a field with a default should work. ... ok
test_add_foo_together (migrations.test_autodetector.AutodetectorTests)
Tests index/unique_together detection. ... ok
test_add_indexes (migrations.test_autodetector.AutodetectorTests)
Test change detection of new indexes. ... ok
test_add_many_to_many (migrations.test_autodetector.AutodetectorTests)
#22435 - Adding a ManyToManyField should not prompt for a default. ... ok
test_add_model_order_with_respect_to (migrations.test_autodetector.AutodetectorTests) ... ok
test_add_non_blank_textfield_and_charfield (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_db_table_add (migrations.test_autodetector.AutodetectorTests)
Tests detection for adding db_table in model's options. ... ok
test_alter_db_table_change (migrations.test_autodetector.AutodetectorTests)
Tests detection for changing db_table in model's options'. ... ok
test_alter_db_table_no_changes (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_db_table_remove (migrations.test_autodetector.AutodetectorTests)
Tests detection for removing db_table in model's options. ... ok
test_alter_db_table_with_model_change (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_field (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of new fields. ... ok
test_alter_field_to_not_null_oneoff_default (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_field_to_not_null_with_default (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_field_to_not_null_without_default (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_fk_before_model_deletion (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_many_to_many (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_model_managers (migrations.test_autodetector.AutodetectorTests) ... ok
test_alter_model_options (migrations.test_autodetector.AutodetectorTests)
Changing a model's options should make a change. ... ok
test_alter_model_options_proxy (migrations.test_autodetector.AutodetectorTests)
Changing a proxy model's options should also make a change. ... ok
test_arrange_for_graph (migrations.test_autodetector.AutodetectorTests)
Tests auto-naming of migrations for graph matching. ... ok
test_bases_first (migrations.test_autodetector.AutodetectorTests)
Bases of other models come first. ... ok
test_circular_dependency_mixed_addcreate (migrations.test_autodetector.AutodetectorTests) ... ok
test_circular_dependency_swappable (migrations.test_autodetector.AutodetectorTests) ... ok
test_circular_dependency_swappable2 (migrations.test_autodetector.AutodetectorTests) ... ok
test_circular_dependency_swappable_self (migrations.test_autodetector.AutodetectorTests) ... ok
test_circular_fk_dependency (migrations.test_autodetector.AutodetectorTests) ... ok
test_concrete_field_changed_to_many_to_many (migrations.test_autodetector.AutodetectorTests) ... ok
test_create_model_and_unique_together (migrations.test_autodetector.AutodetectorTests) ... ok
test_create_model_with_check_constraint (migrations.test_autodetector.AutodetectorTests)
Test creation of new model with constraints already defined. ... ok
test_create_model_with_indexes (migrations.test_autodetector.AutodetectorTests)
Test creation of new model with indexes already defined. ... ok
test_create_with_through_model (migrations.test_autodetector.AutodetectorTests) ... ok
test_custom_deconstructible (migrations.test_autodetector.AutodetectorTests) ... ok
test_custom_migration_name (migrations.test_autodetector.AutodetectorTests)
Tests custom naming of migrations for graph matching. ... ok
test_deconstruct_field_kwarg (migrations.test_autodetector.AutodetectorTests)
Field instances are handled correctly by nested deconstruction. ... ok
test_deconstruct_type (migrations.test_autodetector.AutodetectorTests) ... ok
test_deconstructible_dict (migrations.test_autodetector.AutodetectorTests)
Nested deconstruction descends into dict values. ... ok
test_deconstructible_list (migrations.test_autodetector.AutodetectorTests)
Nested deconstruction descends into lists. ... ok
test_deconstructible_tuple (migrations.test_autodetector.AutodetectorTests)
Nested deconstruction descends into tuples. ... ok
test_default_related_name_option (migrations.test_autodetector.AutodetectorTests) ... ok
test_different_regex_does_alter (migrations.test_autodetector.AutodetectorTests) ... ok
test_empty_foo_together (migrations.test_autodetector.AutodetectorTests) ... ok
test_first_dependency (migrations.test_autodetector.AutodetectorTests) ... ok
test_fk_dependency (migrations.test_autodetector.AutodetectorTests)
Having a ForeignKey automatically adds a dependency. ... ok
test_fk_dependency_other_app (migrations.test_autodetector.AutodetectorTests) ... ok
test_foo_together_no_changes (migrations.test_autodetector.AutodetectorTests) ... ok
test_foo_together_ordering (migrations.test_autodetector.AutodetectorTests) ... ok
test_foo_together_remove_fk (migrations.test_autodetector.AutodetectorTests)
Tests unique_together and field removal detection & ordering ... ok
test_foreign_key_removed_before_target_model (migrations.test_autodetector.AutodetectorTests) ... ok
test_identical_regex_doesnt_alter (migrations.test_autodetector.AutodetectorTests) ... ok
test_keep_db_table_with_model_change (migrations.test_autodetector.AutodetectorTests) ... ok
test_last_dependency (migrations.test_autodetector.AutodetectorTests) ... ok
test_m2m_w_through_multistep_remove (migrations.test_autodetector.AutodetectorTests) ... ok
test_managed_to_unmanaged (migrations.test_autodetector.AutodetectorTests) ... ok
test_many_to_many_changed_to_concrete_field (migrations.test_autodetector.AutodetectorTests) ... ok
test_many_to_many_removed_before_through_model (migrations.test_autodetector.AutodetectorTests) ... ok
test_many_to_many_removed_before_through_model_2 (migrations.test_autodetector.AutodetectorTests) ... ok
test_mti_inheritance_model_removal (migrations.test_autodetector.AutodetectorTests) ... ok
test_multiple_bases (migrations.test_autodetector.AutodetectorTests)
#23956 - Inheriting models doesn't move *_ptr fields into AddField operations. ... ok
test_nested_deconstructible_objects (migrations.test_autodetector.AutodetectorTests) ... ok
test_new_model (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of new models. ... ok
test_non_circular_foreignkey_dependency_removal (migrations.test_autodetector.AutodetectorTests) ... ok
test_old_model (migrations.test_autodetector.AutodetectorTests)
Tests deletion of old models. ... ok
test_order_fields_indexes (migrations.test_autodetector.AutodetectorTests)
Test change detection of reordering of fields in indexes. ... ok
test_pk_fk_included (migrations.test_autodetector.AutodetectorTests) ... ok
test_proxy (migrations.test_autodetector.AutodetectorTests)
The autodetector correctly deals with proxy models. ... ok
test_proxy_bases_first (migrations.test_autodetector.AutodetectorTests)
Bases of proxies come first. ... ok
test_proxy_custom_pk (migrations.test_autodetector.AutodetectorTests) ... ok
test_proxy_fk_dependency (migrations.test_autodetector.AutodetectorTests)
FK dependencies still work on proxy models. ... ok
test_proxy_to_mti_with_fk_to_proxy (migrations.test_autodetector.AutodetectorTests) ... ok
test_proxy_to_mti_with_fk_to_proxy_proxy (migrations.test_autodetector.AutodetectorTests) ... ok
test_remove_alter_order_with_respect_to (migrations.test_autodetector.AutodetectorTests) ... ok
test_remove_constraints (migrations.test_autodetector.AutodetectorTests)
Test change detection of removed constraints. ... ok
test_remove_field (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of removed fields. ... ok
test_remove_field_and_foo_together (migrations.test_autodetector.AutodetectorTests) ... ok
test_remove_foo_together (migrations.test_autodetector.AutodetectorTests)
Tests index/unique_together detection. ... ok
test_remove_indexes (migrations.test_autodetector.AutodetectorTests)
Test change detection of removed indexes. ... ok
test_rename_field (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of renamed fields. ... ok
test_rename_field_and_foo_together (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_field_foreign_key_to_field (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_field_preserved_db_column (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_foreign_object_fields (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_m2m_through_model (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_model (migrations.test_autodetector.AutodetectorTests)
Tests autodetection of renamed models. ... ok
test_rename_model_reverse_relation_dependencies (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_model_with_fks_in_different_position (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_model_with_renamed_rel_field (migrations.test_autodetector.AutodetectorTests) ... ok
test_rename_related_field_preserved_db_column (migrations.test_autodetector.AutodetectorTests) ... ok
test_replace_string_with_foreignkey (migrations.test_autodetector.AutodetectorTests) ... ok
test_same_app_circular_fk_dependency (migrations.test_autodetector.AutodetectorTests) ... ok
test_same_app_circular_fk_dependency_with_unique_together_and_indexes (migrations.test_autodetector.AutodetectorTests) ... ok
test_same_app_no_fk_dependency (migrations.test_autodetector.AutodetectorTests) ... ok
test_set_alter_order_with_respect_to (migrations.test_autodetector.AutodetectorTests)
Setting order_with_respect_to adds a field. ... ok
test_supports_functools_partial (migrations.test_autodetector.AutodetectorTests) ... ok
test_swappable (migrations.test_autodetector.AutodetectorTests) ... ok
test_swappable_changed (migrations.test_autodetector.AutodetectorTests) ... ok
test_swappable_circular_multi_mti (migrations.test_autodetector.AutodetectorTests) ... ok
test_swappable_first_inheritance (migrations.test_autodetector.AutodetectorTests)
Swappable models get their CreateModel first. ... ok
test_swappable_first_setting (migrations.test_autodetector.AutodetectorTests)
Swappable models get their CreateModel first. ... ok
test_trim_apps (migrations.test_autodetector.AutodetectorTests) ... ok
test_unmanaged_create (migrations.test_autodetector.AutodetectorTests)
The autodetector correctly deals with managed models. ... ok
test_unmanaged_custom_pk (migrations.test_autodetector.AutodetectorTests) ... ok
test_unmanaged_delete (migrations.test_autodetector.AutodetectorTests) ... ok
test_unmanaged_to_managed (migrations.test_autodetector.AutodetectorTests) ... ok
test_makemigrations_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_makemigrations_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_migrate_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_migrate_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests) ... ok
ERROR
test_showmigrations_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_showmigrations_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_sqlmigrate_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_sqlmigrate_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_squashmigrations_app_name_specified_as_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_squashmigrations_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests) ... ok
test_check_consistent_history (migrations.test_loader.LoaderTests) ... ok
test_check_consistent_history_squashed (migrations.test_loader.LoaderTests) ... ok
test_explicit_missing_module (migrations.test_loader.LoaderTests) ... ok
test_first (migrations.test_loader.LoaderTests) ... ok
test_ignore_files (migrations.test_loader.LoaderTests)
Files prefixed with underscore, tilde, or dot aren't loaded. ... ok
test_load (migrations.test_loader.LoaderTests) ... ok
test_load_empty_dir (migrations.test_loader.LoaderTests) ... ok
test_load_import_error (migrations.test_loader.LoaderTests) ... ok
test_load_module_file (migrations.test_loader.LoaderTests) ... ok
test_load_unmigrated_dependency (migrations.test_loader.LoaderTests) ... ok
test_loading_squashed (migrations.test_loader.LoaderTests)
Tests loading a squashed migration ... FAIL
test_loading_squashed_complex (migrations.test_loader.LoaderTests)
Tests loading a complex set of squashed migrations ... ok
test_loading_squashed_complex_multi_apps (migrations.test_loader.LoaderTests) ... ok
test_loading_squashed_complex_multi_apps_partially_applied (migrations.test_loader.LoaderTests) ... ok
test_loading_squashed_erroneous (migrations.test_loader.LoaderTests)
Tests loading a complex but erroneous set of squashed migrations ... ok
test_loading_squashed_ref_squashed (migrations.test_loader.LoaderTests)
Tests loading a squashed migration with a new migration referencing it ... ok
test_marked_as_migrated (migrations.test_loader.LoaderTests) ... ok
test_marked_as_unmigrated (migrations.test_loader.LoaderTests) ... ok
test_name_match (migrations.test_loader.LoaderTests)
Tests prefix name matching ... ok
test_plan_handles_repeated_migrations (migrations.test_loader.LoaderTests) ... ok
test_run_before (migrations.test_loader.LoaderTests) ... ok
ERROR
ERROR
ERROR
ERROR
ERROR
test_node_not_found_error_repr (migrations.test_exceptions.ExceptionTests) ... ok
ERROR
test_backwards_nothing_to_do (migrations.test_executor.ExecutorUnitTests) ... ok
test_minimize_rollbacks (migrations.test_executor.ExecutorUnitTests) ... ok
test_minimize_rollbacks_branchy (migrations.test_executor.ExecutorUnitTests) ... ok
test_circular_graph (migrations.test_graph.GraphTests) ... ok
test_circular_graph_2 (migrations.test_graph.GraphTests) ... ok
test_complex_graph (migrations.test_graph.GraphTests) ... ok
test_infinite_loop (migrations.test_graph.GraphTests) ... ok
test_iterative_dfs (migrations.test_graph.GraphTests) ... ok
test_iterative_dfs_complexity (migrations.test_graph.GraphTests) ... ok
test_missing_child_nodes (migrations.test_graph.GraphTests) ... ok
test_missing_parent_nodes (migrations.test_graph.GraphTests) ... ok
test_plan_invalid_node (migrations.test_graph.GraphTests) ... ok
test_remove_replaced_nodes (migrations.test_graph.GraphTests) ... ok
test_remove_replacement_node (migrations.test_graph.GraphTests) ... ok
test_simple_graph (migrations.test_graph.GraphTests) ... ok
test_stringify (migrations.test_graph.GraphTests) ... ok
test_validate_consistency_dummy (migrations.test_graph.GraphTests) ... ok
test_validate_consistency_missing_child (migrations.test_graph.GraphTests) ... ok
test_validate_consistency_missing_parent (migrations.test_graph.GraphTests) ... ok
test_validate_consistency_no_error (migrations.test_graph.GraphTests) ... ok
test_dummynode_repr (migrations.test_graph.NodeTests) ... ok
test_node_repr (migrations.test_graph.NodeTests) ... ok
ERROR
ERROR
test_reference_field_by_through_fields (migrations.test_operations.FieldOperationTests) ... ok
test_references_field_by_from_fields (migrations.test_operations.FieldOperationTests) ... ok
test_references_field_by_name (migrations.test_operations.FieldOperationTests) ... ok
test_references_field_by_remote_field_model (migrations.test_operations.FieldOperationTests) ... ok
test_references_field_by_through (migrations.test_operations.FieldOperationTests) ... ok
test_references_field_by_to_fields (migrations.test_operations.FieldOperationTests) ... ok
test_references_model (migrations.test_operations.FieldOperationTests) ... ok
ERROR
ERROR
test_references_model_mixin (migrations.test_operations.TestCreateModel) ... ok
test_add_field_alter_field (migrations.test_optimizer.OptimizerTests) ... ok
test_add_field_delete_field (migrations.test_optimizer.OptimizerTests) ... ok
test_add_field_rename_field (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_alter_index_model (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_alter_owrt_model (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_alter_table_model (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_alter_unique_model (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_field_delete_field (migrations.test_optimizer.OptimizerTests) ... ok
test_alter_field_rename_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_index_delete_model (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_index_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_model_options (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_owrt_delete_model (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_owrt_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_unique_delete_model (migrations.test_optimizer.OptimizerTests) ... ok
test_create_alter_unique_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_delete_model (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_add_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_add_field_not_through_m2m_through (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_alter_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_no_reordering_for_unrelated_fk (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_no_reordering_of_inherited_model (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_remove_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_rename_field (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_reordering (migrations.test_optimizer.OptimizerTests) ... ok
test_create_model_reordering_circular_fk (migrations.test_optimizer.OptimizerTests) ... ok
test_create_rename_model (migrations.test_optimizer.OptimizerTests) ... ok
test_optimize_elidable_operation (migrations.test_optimizer.OptimizerTests) ... ok
test_optimize_through_create (migrations.test_optimizer.OptimizerTests) ... ok
test_optimize_through_fields (migrations.test_optimizer.OptimizerTests) ... ok
test_rename_model_self (migrations.test_optimizer.OptimizerTests) ... ok
test_single (migrations.test_optimizer.OptimizerTests) ... ok
test_ask_initial_with_disabled_migrations (migrations.test_questioner.QuestionerTests) ... ok
test_timedelta_default (migrations.test_questioner.QuestionerTests) ... ok
test_abstract_model_children_inherit_indexes (migrations.test_state.ModelStateTests) ... ok
test_bound_field_sanity_check (migrations.test_state.ModelStateTests) ... ok
test_create_swappable (migrations.test_state.ModelStateTests) ... ok
test_create_swappable_from_abstract (migrations.test_state.ModelStateTests) ... ok
test_custom_manager_swappable (migrations.test_state.ModelStateTests) ... ok
test_custom_model_base (migrations.test_state.ModelStateTests) ... ok
test_explicit_index_name (migrations.test_state.ModelStateTests) ... ok
test_fields_immutability (migrations.test_state.ModelStateTests) ... ok
test_from_model_constraints (migrations.test_state.ModelStateTests) ... ok
test_order_with_respect_to_private_field (migrations.test_state.ModelStateTests) ... ok
test_repr (migrations.test_state.ModelStateTests) ... ok
test_sanity_check_through (migrations.test_state.ModelStateTests) ... ok
test_sanity_check_to (migrations.test_state.ModelStateTests) ... ok
test_sanity_index_name (migrations.test_state.ModelStateTests) ... ok
test_abstract_base (migrations.test_state.RelatedModelsTests) ... ok
test_base (migrations.test_state.RelatedModelsTests) ... ok
test_base_to_base_fk (migrations.test_state.RelatedModelsTests) ... ok
test_base_to_subclass_fk (migrations.test_state.RelatedModelsTests) ... ok
test_circle (migrations.test_state.RelatedModelsTests) ... ok
test_direct_fk (migrations.test_state.RelatedModelsTests) ... ok
test_direct_hidden_fk (migrations.test_state.RelatedModelsTests) ... ok
test_direct_m2m (migrations.test_state.RelatedModelsTests) ... ok
test_direct_m2m_self (migrations.test_state.RelatedModelsTests) ... ok
test_fk_through_proxy (migrations.test_state.RelatedModelsTests) ... ok
test_generic_fk (migrations.test_state.RelatedModelsTests) ... ok
test_intermediate_m2m (migrations.test_state.RelatedModelsTests) ... ok
test_intermediate_m2m_base (migrations.test_state.RelatedModelsTests) ... ok
test_intermediate_m2m_extern_fk (migrations.test_state.RelatedModelsTests) ... ok
test_intermediate_m2m_self (migrations.test_state.RelatedModelsTests) ... ok
test_multiple_bases (migrations.test_state.RelatedModelsTests) ... ok
test_multiple_mixed_bases (migrations.test_state.RelatedModelsTests) ... ok
test_multiple_nested_bases (migrations.test_state.RelatedModelsTests) ... ok
test_nested_abstract_base (migrations.test_state.RelatedModelsTests) ... ok
test_nested_base (migrations.test_state.RelatedModelsTests) ... ok
test_nested_fk (migrations.test_state.RelatedModelsTests) ... ok
test_nested_proxy_base (migrations.test_state.RelatedModelsTests) ... ok
test_proxy_base (migrations.test_state.RelatedModelsTests) ... ok
test_two_sided (migrations.test_state.RelatedModelsTests) ... ok
test_unrelated (migrations.test_state.RelatedModelsTests) ... ok
test_add_relations (migrations.test_state.StateTests) ... ok
test_apps_bulk_update (migrations.test_state.StateTests) ... ok
test_choices_iterator (migrations.test_state.StateTests) ... ok
test_create (migrations.test_state.StateTests) ... ok
test_custom_base_manager (migrations.test_state.StateTests) ... ok
test_custom_default_manager (migrations.test_state.StateTests) ... ok
test_custom_default_manager_added_to_the_model_state (migrations.test_state.StateTests) ... ok
test_custom_default_manager_named_objects_with_false_migration_flag (migrations.test_state.StateTests) ... ok
test_dangling_references_throw_error (migrations.test_state.StateTests) ... ok
test_equality (migrations.test_state.StateTests) ... ok
test_ignore_order_wrt (migrations.test_state.StateTests) ... ok
test_manager_refer_correct_model_version (migrations.test_state.StateTests) ... ok
test_no_duplicate_managers (migrations.test_state.StateTests) ... ok
test_real_apps (migrations.test_state.StateTests) ... ok
test_remove_relations (migrations.test_state.StateTests) ... ok
test_render (migrations.test_state.StateTests) ... ok
test_render_model_inheritance (migrations.test_state.StateTests) ... ok
test_render_model_with_multiple_inheritance (migrations.test_state.StateTests) ... ok
test_render_project_dependencies (migrations.test_state.StateTests) ... ok
test_render_unique_app_labels (migrations.test_state.StateTests) ... ok
test_self_relation (migrations.test_state.StateTests) ... ok
test_args_kwargs_signature (migrations.test_writer.OperationWriterTests) ... ok
test_args_signature (migrations.test_writer.OperationWriterTests) ... ok
test_empty_signature (migrations.test_writer.OperationWriterTests) ... ok
test_expand_args_signature (migrations.test_writer.OperationWriterTests) ... ok
test_kwargs_signature (migrations.test_writer.OperationWriterTests) ... ok
test_multiline_args_signature (migrations.test_writer.OperationWriterTests) ... ok
test_nested_args_signature (migrations.test_writer.OperationWriterTests) ... ok
test_nested_operation_expand_args_signature (migrations.test_writer.OperationWriterTests) ... ok
test_custom_operation (migrations.test_writer.WriterTests) ... ok
test_deconstruct_class_arguments (migrations.test_writer.WriterTests) ... ok
test_migration_file_header_comments (migrations.test_writer.WriterTests) ... ok
test_migration_path (migrations.test_writer.WriterTests) ... ok
test_models_import_omitted (migrations.test_writer.WriterTests) ... ok
test_register_non_serializer (migrations.test_writer.WriterTests) ... ok
test_register_serializer (migrations.test_writer.WriterTests) ... ok
test_serialize_builtin_types (migrations.test_writer.WriterTests) ... ok
test_serialize_builtins (migrations.test_writer.WriterTests) ... ok
test_serialize_class_based_validators (migrations.test_writer.WriterTests) ... ok
test_serialize_collections (migrations.test_writer.WriterTests) ... ok
test_serialize_compiled_regex (migrations.test_writer.WriterTests) ... ok
test_serialize_constants (migrations.test_writer.WriterTests) ... ok
test_serialize_datetime (migrations.test_writer.WriterTests) ... ok
test_serialize_empty_nonempty_tuple (migrations.test_writer.WriterTests) ... ok
test_serialize_enums (migrations.test_writer.WriterTests) ... ok
test_serialize_fields (migrations.test_writer.WriterTests) ... ok
test_serialize_frozensets (migrations.test_writer.WriterTests) ... ok
test_serialize_functions (migrations.test_writer.WriterTests) ... ok
test_serialize_functools_partial (migrations.test_writer.WriterTests) ... ok
test_serialize_functools_partialmethod (migrations.test_writer.WriterTests) ... ok
test_serialize_iterators (migrations.test_writer.WriterTests) ... ok
test_serialize_lazy_objects (migrations.test_writer.WriterTests) ... ok
test_serialize_local_function_reference (migrations.test_writer.WriterTests)
A reference in a local scope can't be serialized. ... ok
test_serialize_managers (migrations.test_writer.WriterTests) ... ok
test_serialize_multiline_strings (migrations.test_writer.WriterTests) ... ok
test_serialize_numbers (migrations.test_writer.WriterTests) ... ok
test_serialize_range (migrations.test_writer.WriterTests) ... ok
test_serialize_set (migrations.test_writer.WriterTests) ... ok
test_serialize_settings (migrations.test_writer.WriterTests) ... ok
test_serialize_strings (migrations.test_writer.WriterTests) ... ok
test_serialize_timedelta (migrations.test_writer.WriterTests) ... ok
test_serialize_type_none (migrations.test_writer.WriterTests) ... ok
test_serialize_unbound_method_reference (migrations.test_writer.WriterTests)
An unbound method used within a class body can be serialized. ... ok
test_serialize_uuid (migrations.test_writer.WriterTests) ... ok
test_simple_migration (migrations.test_writer.WriterTests) ... ok
test_sorted_imports (migrations.test_writer.WriterTests) ... ok

======================================================================
ERROR: test_migrate_nonexistent_app_label (migrations.test_commands.AppLabelErrorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 565, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.ALREADY_EXISTS
	details = "Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission."
	debug_error_string = "{"created":"@1575450661.936621000","description":"Error received from peer ipv4:172.217.11.170:443","file":"src/core/lib/surface/call.cc","file_line":1046,"grpc_message":"Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.","grpc_status":6}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 94, in execute
    args if args else None,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/session.py", line 312, in run_in_transaction
    txn.commit()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/transaction.py", line 127, in commit
    metadata=metadata,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/cloud/spanner_v1/gapic/spanner_client.py", line 1559, in commit
    request, retry=retry, timeout=timeout, metadata=metadata
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
    return wrapped_func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/retry.py", line 277, in retry_wrapped_func
    on_error=on_error,
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/retry.py", line 182, in retry_target
    return target()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
    return func(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.AlreadyExists: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 104, in execute
    raise IntegrityError(e.details if hasattr(e, 'details') else e)
spanner.dbapi.exceptions.IntegrityError: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 274, in __call__
    self._post_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1009, in _post_teardown
    self._fixture_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1173, in _fixture_teardown
    return super()._fixture_teardown()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1044, in _fixture_teardown
    inhibit_post_migrate=inhibit_post_migrate)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/__init__.py", line 148, in call_command
    return command.execute(*args, **defaults)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/commands/flush.py", line 80, in handle
    emit_post_migrate_signal(verbosity, interactive, database)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/core/management/sql.py", line 51, in emit_post_migrate_signal
    **kwargs
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/dispatch/dispatcher.py", line 175, in send
    for receiver in self._live_receivers(sender)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/dispatch/dispatcher.py", line 175, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/contrib/auth/management/__init__.py", line 83, in create_permissions
    Permission.objects.using(using).bulk_create(perms)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 468, in bulk_create
    self._batched_insert(objs_with_pk, fields, batch_size, ignore_conflicts=ignore_conflicts)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 1211, in _batched_insert
    self._insert(item, fields=fields, using=self.db, ignore_conflicts=ignore_conflicts)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/query.py", line 1186, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/models/sql/compiler.py", line 1335, in execute_sql
    cursor.execute(sql, params)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/spanner/dbapi/cursor.py", line 104, in execute
    raise IntegrityError(e.details if hasattr(e, 'details') else e)
django.db.utils.IntegrityError: 409 Unique index violation on index auth_permission_content_type_id_codename_01ab375a_uniq at index key [2415126027207527014,add_permission,3180010924288205830]. It conflicts with row [3180010924288205830] in table auth_permission.

======================================================================
ERROR: setUpClass (migrations.test_loader.RecorderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 1123, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_loader.RecorderTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.MakeMigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.MakeMigrationsTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.MigrateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.MigrateTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_commands.SquashMigrationsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_commands.SquashMigrationsTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_deprecated_fields.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_deprecated_fields.Tests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_executor.ExecutorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_executor.ExecutorTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_loader.PycLoaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_loader.PycLoaderTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_multidb.MultiDBOperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_multidb.MultiDBOperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_operations.OperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_operations.OperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
ERROR: setUpClass (migrations.test_operations.SwappableOperationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_operations.py", line 27, in setUpClass
    super().setUpClass()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 197, in setUpClass
    cls._add_databases_failures()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 218, in _add_databases_failures
    cls.databases = cls._validate_databases()
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/testcases.py", line 213, in _validate_databases
    raise ImproperlyConfigured(message)
django.core.exceptions.ImproperlyConfigured: migrations.test_operations.SwappableOperationTests.databases refers to 'other' which is not defined in settings.DATABASES.

======================================================================
FAIL: test_loading_squashed (migrations.test_loader.LoaderTests)
Tests loading a squashed migration
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/django/test/utils.py", line 373, in inner
    return func(*args, **kwargs)
  File "/Users/emmanuelodeke/Desktop/spanner-orm/django_tests/django/tests/migrations/test_loader.py", line 255, in test_loading_squashed
    2,
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 313 tests in 790.759s

FAILED (failures=1, errors=11)
Preserving test database for alias 'default' ('db1')...
```
</details>


Discussion:

Resolving patch:
diff --git a/django_spanner/features.py b/django_spanner/features.py
--- a/django_spanner/features.py
+++ b/django_spanner/features.py
@@ -222,7 +222,11 @@ class DatabaseFeatures(BaseDatabaseFeatures):
         # duplicate table raises GoogleAPICallError rather than DatabaseError:
         # https://github.com/orijtech/django-spanner/issues/344
         'backends.tests.BackendTestCase.test_duplicate_table_error',
+        'migrations.test_commands.MigrateTests.test_migrate_fake_initial',
+        'migrations.test_commands.MigrateTests.test_migrate_initial_false',
+        'migrations.test_executor.ExecutorTests.test_soft_apply',
         # Spanner limitation: Cannot change type of column.
+        'migrations.test_executor.ExecutorTests.test_alter_id_type_with_fk',
         'schema.tests.SchemaTests.test_alter_auto_field_to_char_field',
         'schema.tests.SchemaTests.test_alter_text_field_to_date_field',
         'schema.tests.SchemaTests.test_alter_text_field_to_datetime_field',
@@ -263,6 +267,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
         'schema.tests.SchemaTests.test_primary_key',
         # Spanner limitation:  Cannot remove a column from the primary key.
         'schema.tests.SchemaTests.test_alter_int_pk_to_int_unique',
+        # Spanner limitation: migrations aren't atomic since Spanner doesn't
+        # support transactions.
+        'migrations.test_executor.ExecutorTests.test_atomic_operation_in_non_atomic_migration',
         # changing a not null constraint isn't allowed if it affects an index:
         # https://github.com/orijtech/django-spanner/issues/378
         'migrations.test_operations.OperationTests.test_alter_field_with_index',
@@ -272,6 +279,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
         # This test doesn't flush the database properly:
         # https://code.djangoproject.com/ticket/31398
         'multiple_database.tests.AuthTestCase',
+        # This test isn't isolated on databases like Spanner that don't
+        # support transactions: https://code.djangoproject.com/ticket/31413
+        'migrations.test_loader.LoaderTests.test_loading_squashed',
         # "Permission errors are not swallowed":
         # https://github.com/googleapis/python-spanner-django/issues/407
         'file_uploads.tests.DirectoryCreationTests.test_readonly_root',


Test patch:
diff --git a/django_test_apps.txt b/django_test_apps.txt
--- a/django_test_apps.txt
+++ b/django_test_apps.txt
@@ -60,8 +60,8 @@ many_to_one
 many_to_one_null
 max_lengths
 migrate_signals
+migrations
 migration_test_data_persistence
-migrations.test_operations
 model_fields.test_binaryfield
 model_fields.test_booleanfield
 model_fields.test_charfield