Skip to content

Commit c4d87b8

Browse files
committed
remove further tests
1 parent 71f4a9a commit c4d87b8

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

README.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ We hope you enjoy using the MSSQL-Django 3rd party backend.
1111
## Features
1212

1313
- Supports Django 3.2, 4.0, 4.1, 4.2, 5.0, 5.1, and 5.2
14+
- **Django 5.0 and below**: Full production support
15+
- **Django 5.1**: Supported with minor limitations (composite primary key inspectdb)
16+
- **Django 5.2**: Supported with documented limitations (see Django 5.2 Specific Limitations section below)
1417
- Tested on Microsoft SQL Server 2016, 2017, 2019, 2022
1518
- Passes most of the tests of the Django test suite
1619
- Compatible with
@@ -273,12 +276,42 @@ The following features are currently not fully supported:
273276
- Date extract function
274277
- Bulk insert into a table with a trigger and returning the rows inserted
275278

279+
### Django 5.1 Specific Limitations
280+
281+
Django 5.1 introduces composite primary key support which has limited compatibility with SQL Server:
282+
- **inspectdb command**: Cannot properly inspect tables with composite primary keys
283+
- **Backend debugging**: SQL execution wrapper debug functionality may not work correctly
284+
- **Schema operations**: Some field unique constraint removal operations may have issues
285+
- Most other Django 5.1 features work correctly with SQL Server
286+
276287
### Django 5.2 Specific Limitations
277288

278-
Django 5.2 introduces some new features that require SQL Server-specific implementations:
279-
- Tuple lookups (e.g., `(col1, col2) IN (...)`) are not supported by SQL Server and need conversion to individual column comparisons
280-
- Complex aggregation queries with filtered references may need optimization for SQL Server
281-
- These limitations are documented in the test exclusions and are good candidates for community contributions
289+
Django 5.2 introduces new features that may cause regressions for existing Django 5.0+ applications. The following features have known limitations when upgrading to Django 5.2:
290+
291+
**Critical Limitations (May Affect Common Use Cases):**
292+
- **Tuple lookups**: Queries like `Model.objects.filter((col1, col2)__in=[(val1, val2)])` will fail with SQL syntax errors as SQL Server doesn't support `(col1, col2) IN (...)` syntax
293+
- **Multi-column foreign key relationships**: Complex queries involving foreign keys with multiple columns may fail in Django 5.2 due to tuple lookup generation
294+
- **JSONField with special characters**: JSONField lookups involving special characters (quotes, emojis, escape sequences) may generate invalid SQL
295+
- **JSONField bulk updates**: Bulk update operations on JSONField with null handling may fail
296+
297+
**Moderate Impact:**
298+
- **Complex aggregations**: Some aggregation queries with filtered references and subqueries may not work correctly
299+
- **Prefetch operations**: `prefetch_related()` operations on multi-column foreign keys may fail
300+
- **Migration data persistence**: Issues with migration data persistence tests involving table names with spaces
301+
302+
**Low Impact (Edge Cases):**
303+
- **Migration operations**: Advanced migration operations involving composite primary keys and generated fields
304+
- **Backend debugging**: Certain backend debugging and introspection features
305+
- **JSONField CASE WHEN updates**: JSONField updates using CASE WHEN expressions with null handling
306+
307+
**Specific Test Failures in Django 5.2:**
308+
- All `foreign_object.test_tuple_lookups.TupleLookupsTests.*` tests
309+
- All `foreign_object.tests.MultiColumnFKTests.*` tests involving complex queries
310+
- `model_fields.test_jsonfield.TestQuerying.test_lookups_special_chars*` tests
311+
- `queries.test_bulk_update.BulkUpdateTests.test_json_field_sql_null` test
312+
- Various migration and backend debugging tests
313+
314+
**Workaround**: These limitations are documented in the test exclusions (`testapp/settings.py`) and are excellent candidates for community contributions. Applications using Django 5.0 and below are unaffected by these limitations.
282315

283316
JSONField lookups have limitations, more details [here](https://github.com/microsoft/mssql-django/wiki/JSONField).
284317

testapp/settings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,9 @@
330330
'foreign_object.test_tuple_lookups.TupleLookupsTests.test_tuple_in_subquery',
331331
'foreign_object.test_agnostic_order_trimjoin.TestLookupQuery.test_deep_mixed_backward',
332332

333-
# Migration data persistence - table name with spaces issue
333+
# Migration data persistence - exclude entire module due to table name with spaces issue
334+
'migration_test_data_persistence',
335+
'migration_test_data_persistence.tests',
334336
'migration_test_data_persistence.tests.MigrationDataPersistenceClassSetup',
335337

336338
# Multi-column foreign key tests with tuple lookups - also affected by SQL Server limitations
@@ -357,7 +359,6 @@
357359
# TODO: Implement composite primary key support
358360
'migrations.test_operations.OperationTests.test_composite_pk_operations',
359361
'migrations.test_operations.OperationTests.test_generated_field_changes_output_field',
360-
'migration_test_data_persistence.tests.MigrationDataPersistenceClassSetup.test_migration_data_persistence',
361362

362363
# Backend and schema test failures
363364
# TODO: Fix SQL Server specific backend behavior

0 commit comments

Comments
 (0)