diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index a870b0e8d..dd449bb13 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -100,7 +100,7 @@ jobs: many_to_many many_to_one many_to_one_null - migrations.test_operations + migrations model_fields model_forms mutually_referential diff --git a/README.md b/README.md index c9f796ee1..7bd3fafa5 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,9 @@ from the new application's `apps.py` file. - You can study the skipped tests in `DatabaseFeatures.django_test_skips` for more details on known issues. +- Due to the lack of ability to introspect MongoDB collection schema, + `migrate --fake-initial` isn't supported. + ## Troubleshooting TODO diff --git a/django_mongodb/features.py b/django_mongodb/features.py index 4667b2637..c001de119 100644 --- a/django_mongodb/features.py +++ b/django_mongodb/features.py @@ -533,6 +533,8 @@ def django_test_expected_failures(self): "expressions.tests.BasicExpressionsTests.test_annotate_values_filter", "expressions.tests.BasicExpressionsTests.test_filtering_on_rawsql_that_is_boolean", "expressions.tests.BasicExpressionsTests.test_order_by_multiline_sql", + "migrations.test_commands.MigrateTests.test_migrate_plan", + "migrations.test_multidb.MultiDBOperationTests.test_run_sql_migrate_foo_router_with_hints", "migrations.test_operations.OperationTests.test_run_sql", "migrations.test_operations.OperationTests.test_run_sql_params", "migrations.test_operations.OperationTests.test_separate_database_and_state", @@ -667,8 +669,25 @@ def django_test_expected_failures(self): }, "transaction.atomic() is not supported.": { "backends.base.test_base.DatabaseWrapperLoggingTests", + "migrations.test_executor.ExecutorTests.test_atomic_operation_in_non_atomic_migration", "migrations.test_operations.OperationTests.test_run_python_atomic", }, + "migrate --fake-initial is not supported.": { + "migrations.test_commands.MigrateTests.test_migrate_fake_initial", + "migrations.test_commands.MigrateTests.test_migrate_fake_split_initial", + "migrations.test_executor.ExecutorTests.test_soft_apply", + }, + "SchemaEditor doesn't log or collect queries.": { + # https://github.com/mongodb-labs/django-mongodb/issues/141 + "migrations.test_commands.MigrateTests.test_migrate_syncdb_app_label", + "migrations.test_commands.MigrateTests.test_migrate_syncdb_deferred_sql_executed_with_schemaeditor", + "migrations.test_commands.MigrateTests.test_sqlmigrate_backwards", + "migrations.test_commands.MigrateTests.test_sqlmigrate_for_non_atomic_migration", + "migrations.test_commands.MigrateTests.test_sqlmigrate_for_non_transactional_databases", + "migrations.test_commands.MigrateTests.test_sqlmigrate_forwards", + "migrations.test_commands.MigrateTests.test_sqlmigrate_replaced_migration", + "migrations.test_commands.MigrateTests.test_sqlmigrate_squashed_migration", + }, } @cached_property diff --git a/django_mongodb/schema.py b/django_mongodb/schema.py index 4e0f3581b..82592820c 100644 --- a/django_mongodb/schema.py +++ b/django_mongodb/schema.py @@ -1,7 +1,10 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from .query import wrap_database_errors + class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): + @wrap_database_errors def create_model(self, model): self.connection.database.create_collection(model._meta.db_table) # Make implicit M2M tables.