Skip to content

Commit 9253a74

Browse files
committed
add migrations.test_operations to CI
1 parent 4f3b81b commit 9253a74

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
many_to_many
9898
many_to_one
9999
many_to_one_null
100+
migrations.test_operations
100101
model_fields
101102
model_forms
102103
mutually_referential

django_mongodb/features.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
1414
supports_column_check_constraints = False
1515
supports_date_lookup_using_string = False
1616
supports_explaining_query_execution = True
17+
supports_expression_defaults = False
1718
supports_expression_indexes = False
1819
supports_foreign_keys = False
1920
supports_ignore_conflicts = False
@@ -84,6 +85,12 @@ class DatabaseFeatures(BaseDatabaseFeatures):
8485
"backends.tests.ThreadTests.test_closing_non_shared_connections",
8586
"backends.tests.ThreadTests.test_default_connection_thread_local",
8687
# Add/RemoveIndex
88+
"migrations.test_operations.OperationTests.test_add_index",
89+
"migrations.test_operations.OperationTests.test_alter_field_with_index",
90+
"migrations.test_operations.OperationTests.test_remove_index",
91+
"migrations.test_operations.OperationTests.test_rename_index",
92+
"migrations.test_operations.OperationTests.test_rename_index_unknown_unnamed_index",
93+
"migrations.test_operations.OperationTests.test_rename_index_unnamed_index",
8794
"schema.tests.SchemaTests.test_add_remove_index",
8895
"schema.tests.SchemaTests.test_composed_desc_index_with_fk",
8996
"schema.tests.SchemaTests.test_composed_index_with_fk",
@@ -111,13 +118,26 @@ class DatabaseFeatures(BaseDatabaseFeatures):
111118
"schema.tests.SchemaTests.test_unique",
112119
"schema.tests.SchemaTests.test_unique_and_reverse_m2m",
113120
# alter_index_together
121+
"migrations.test_operations.OperationTests.test_alter_index_together",
114122
"schema.tests.SchemaTests.test_index_together",
115123
# alter_unique_together
124+
"migrations.test_operations.OperationTests.test_alter_unique_together",
116125
"schema.tests.SchemaTests.test_unique_together",
117126
# add/remove_constraint
127+
"introspection.tests.IntrospectionTests.test_get_constraints",
128+
"migrations.test_operations.OperationTests.test_add_partial_unique_constraint",
129+
"migrations.test_operations.OperationTests.test_create_model_with_partial_unique_constraint",
130+
"migrations.test_operations.OperationTests.test_remove_partial_unique_constraint",
118131
"schema.tests.SchemaTests.test_composed_constraint_with_fk",
119132
"schema.tests.SchemaTests.test_remove_ignored_unique_constraint_not_create_fk_index",
120133
"schema.tests.SchemaTests.test_unique_constraint",
134+
# pymongo.errors.OperationFailure: Can't rename a collection to itself
135+
"migrations.test_operations.OperationTests.test_alter_model_table_noop",
136+
"migrations.test_operations.OperationTests.test_rename_model_no_relations_with_db_table_noop",
137+
"migrations.test_operations.OperationTests.test_rename_model_with_db_table_rename_m2m",
138+
# subclasses of BaseDatabaseIntrospection may require a get_constraints() method
139+
"migrations.test_operations.OperationTests.test_add_func_unique_constraint",
140+
"migrations.test_operations.OperationTests.test_remove_func_unique_constraint",
121141
}
122142
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
123143
_django_test_expected_failures_bitwise = {
@@ -142,6 +162,14 @@ def django_test_expected_failures(self):
142162
# bson.errors.InvalidDocument: cannot encode object:
143163
# <django.db.models.expressions.DatabaseDefault
144164
"basic.tests.ModelInstanceCreationTests.test_save_primary_with_db_default",
165+
"migrations.test_operations.OperationTests.test_add_field_both_defaults",
166+
"migrations.test_operations.OperationTests.test_add_field_database_default",
167+
"migrations.test_operations.OperationTests.test_add_field_database_default_special_char_escaping",
168+
"migrations.test_operations.OperationTests.test_alter_field_add_database_default",
169+
"migrations.test_operations.OperationTests.test_alter_field_change_blank_nullable_database_default_to_not_null",
170+
"migrations.test_operations.OperationTests.test_alter_field_change_default_to_database_default",
171+
"migrations.test_operations.OperationTests.test_alter_field_change_nullable_to_database_default_not_null",
172+
"migrations.test_operations.OperationTests.test_alter_field_change_nullable_to_decimal_database_default_not_null",
145173
"schema.tests.SchemaTests.test_db_default_output_field_resolving",
146174
"schema.tests.SchemaTests.test_rename_keep_db_default",
147175
},
@@ -157,6 +185,10 @@ def django_test_expected_failures(self):
157185
"db_functions.math.test_round.RoundTests.test_decimal_with_precision",
158186
"db_functions.math.test_round.RoundTests.test_float_with_precision",
159187
},
188+
"MongoDB doesn't rename an index when a field is renamed.": {
189+
"migrations.test_operations.OperationTests.test_rename_field_index_together",
190+
"migrations.test_operations.OperationTests.test_rename_field_unique_together",
191+
},
160192
"Pattern lookups on UUIDField are not supported.": {
161193
"model_fields.test_uuid.TestQuerying.test_contains",
162194
"model_fields.test_uuid.TestQuerying.test_endswith",
@@ -186,6 +218,10 @@ def django_test_expected_failures(self):
186218
"lookup.tests.LookupTests.test_in_ignore_none_with_unhashable_items",
187219
"m2m_through_regress.tests.ThroughLoadDataTestCase.test_sequence_creation",
188220
"many_to_many.tests.ManyToManyTests.test_add_remove_invalid_type",
221+
"migrations.test_operations.OperationTests.test_autofield__bigautofield_foreignfield_growth",
222+
"migrations.test_operations.OperationTests.test_model_with_bigautofield",
223+
"migrations.test_operations.OperationTests.test_smallfield_autofield_foreignfield_growth",
224+
"migrations.test_operations.OperationTests.test_smallfield_bigautofield_foreignfield_growth",
189225
"model_fields.test_autofield.AutoFieldTests",
190226
"model_fields.test_autofield.BigAutoFieldTests",
191227
"model_fields.test_autofield.SmallAutoFieldTests",
@@ -503,6 +539,9 @@ def django_test_expected_failures(self):
503539
"expressions.tests.BasicExpressionsTests.test_annotate_values_filter",
504540
"expressions.tests.BasicExpressionsTests.test_filtering_on_rawsql_that_is_boolean",
505541
"expressions.tests.BasicExpressionsTests.test_order_by_multiline_sql",
542+
"migrations.test_operations.OperationTests.test_run_sql",
543+
"migrations.test_operations.OperationTests.test_run_sql_params",
544+
"migrations.test_operations.OperationTests.test_separate_database_and_state",
506545
"model_fields.test_jsonfield.TestQuerying.test_key_sql_injection_escape",
507546
"model_fields.test_jsonfield.TestQuerying.test_key_transform_raw_expression",
508547
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_raw_expression",
@@ -632,6 +671,7 @@ def django_test_expected_failures(self):
632671
},
633672
"transaction.atomic() is not supported.": {
634673
"backends.base.test_base.DatabaseWrapperLoggingTests",
674+
"migrations.test_operations.OperationTests.test_run_python_atomic",
635675
},
636676
}
637677

0 commit comments

Comments
 (0)