#21099 closed Bug (fixed)
DistinctOnTests.setUp() breaks when DatabaseFeature.ignores_nulls_in_unique_constraints = True
Description ¶
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)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Wrapping the whole class seems like the correct solution to me.
comment:4 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 12 years ago
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.