[Django] #21099: DistinctOnTests.setUp() breaks when DatabaseFeature.ignores_nulls_in_unique_constraints = True

2 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Django

ungelesen,
12.09.2013, 12:43:3512.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-----------------------------------+--------------------
Reporter: manfre | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/21099>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

ungelesen,
12.09.2013, 12:48:0712.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-----------------------------------+--------------------------------------

Reporter: manfre | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by manfre):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:1>

Django

ungelesen,
12.09.2013, 14:07:0612.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-----------------------------------+------------------------------------

Reporter: manfre | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by akaariai):

* stage: Unreviewed => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:2>

Django

ungelesen,
12.09.2013, 14:33:4012.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-----------------------------------+------------------------------------

Reporter: manfre | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by manfre):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/1622

--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:3>

Django

ungelesen,
12.09.2013, 14:45:4212.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-------------------------------------+-------------------------------------

Reporter: manfre | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by akaariai):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:4>

Django

ungelesen,
12.09.2013, 15:53:3212.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-------------------------------------+-------------------------------------
Reporter: manfre | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Manfre <mmanfre@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"018037736fe575307f5331ebb4b126a0c886ecef"]:
{{{
#!CommitTicketReference repository=""
revision="018037736fe575307f5331ebb4b126a0c886ecef"
Fixed #21099 - Skip DistinctOnTests unless backend can_distinct_on_fields
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:5>

Django

ungelesen,
12.09.2013, 15:53:3312.09.13
an django-...@googlegroups.com
#21099: DistinctOnTests.setUp() breaks when
DatabaseFeature.ignores_nulls_in_unique_constraints = True
-------------------------------------+-------------------------------------
Reporter: manfre | Owner: nobody
Type: Bug | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"e4c6fca6d21f6a6d16bd69d86928270b4d2d38fb"]:
{{{
#!CommitTicketReference repository=""
revision="e4c6fca6d21f6a6d16bd69d86928270b4d2d38fb"
Merge pull request #1622 from manfre/ticket-21099

Fixed #21099 - Skip DistinctOnTests unless backend

can_distinct_on_field...
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21099#comment:6>

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten