Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#15545 closed (fixed)

admin_filterspecs tests fail on PostgreSQL

Reported by: Łukasz Rekucki Owned by: Łukasz Rekucki
Component: contrib.admin Version: master
Severity: Keywords: postgresql blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

======================================================================
FAIL: test_RelatedFilterSpec_ForeignKey (regressiontests.admin_filterspecs.tests.FilterSpecsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lrekucki/django/django-gh/tests/regressiontests/admin_filterspecs/tests.py", line 85, in test_RelatedFilterSpec_ForeignKey
    self.assertEqual(choices[1]['selected'], True)
AssertionError: False != True

======================================================================
FAIL: test_RelatedFilterSpec_ManyToMany (regressiontests.admin_filterspecs.tests.FilterSpecsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lrekucki/django/django-gh/tests/regressiontests/admin_filterspecs/tests.py", line 111, in test_RelatedFilterSpec_ManyToMany
    self.assertEqual(choices[2]['selected'], True)
AssertionError: False != True

======================================================================
FAIL: test_RelatedFilterSpec_reverse_relationships (regressiontests.admin_filterspecs.tests.FilterSpecsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lrekucki/django/django-gh/tests/regressiontests/admin_filterspecs/tests.py", line 139, in test_RelatedFilterSpec_reverse_relationships
    self.assertEqual(choices[1]['selected'], True)
AssertionError: False != True

----------------------------------------------------------------------

Attachments (1)

ticket15545.diff (6.1 KB) - added by Łukasz Rekucki 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by Béres Botond

Component: Uncategorizeddjango.contrib.admin
Keywords: blocker added
milestone: 1.3
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Changed 6 years ago by Łukasz Rekucki

Attachment: ticket15545.diff added

comment:2 Changed 6 years ago by Łukasz Rekucki

Has patch: set

This and other failures result from false assumptions about primary keys and model ordering. This patch should make assertions db-independent.

comment:3 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

In [15741]:

Fixed #15545 -- Corrected the admin filterspecs tests to be non-dependent on PK allocation or model ordering. Thanks to Łukasz Rekucki for the report and patch.

comment:4 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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