Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21099 closed Bug (fixed)

DistinctOnTests.setUp() breaks when DatabaseFeature.ignores_nulls_in_unique_constraints = True

Reported by: Michael Manfre Owned by: nobody
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

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 Michael Manfre, 11 years ago

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.

comment:2 by Anssi Kääriäinen, 11 years ago

Triage Stage: UnreviewedAccepted

Wrapping the whole class seems like the correct solution to me.

comment:4 by Anssi Kääriäinen, 11 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Michael Manfre <mmanfre@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 018037736fe575307f5331ebb4b126a0c886ecef:

Fixed #21099 - Skip DistinctOnTests unless backend can_distinct_on_fields

comment:6 by Claude Paroz <claude@…>, 11 years ago

In e4c6fca6d21f6a6d16bd69d86928270b4d2d38fb:

Merge pull request #1622 from manfre/ticket-21099

Fixed #21099 - Skip DistinctOnTests unless backend can_distinct_on_field...

Note: See TracTickets for help on using tickets.
Back to Top