DistinctOnTests.setUp() breaks when DatabaseFeature.ignores_nulls_in_unique_constraints = True
Django-mssql doesn't implement can_distinct_on_fields
, but the DistinctOnTests fail because the test setUp creates Celebrity records without specifying a value for a nullable field that has a unique constraint. Any database backend with ignores_nulls_in_unique_constraints = False
will error on this setup, even if they would skip the tests.
I'm not in a position to run these tests to determine if the greatest_fan
value can be set to something other than NULL.
Change History
(6)
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
It might be worth wrapping setUp(), or the entire class with a
can_distinct_on_fields
check to avoid doing the test prep work for every backend other than postgresql_psycopg2.