Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#8787 closed (fixed)

Tests are currently failing on django trunk

Reported by: Alex Gaynor Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: 1.0-blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


It's the admin_widget tests.

Attachments (2)

django-admin-widget-test.diff (4.6 KB) - added by Alex Gaynor 9 years ago.
django-admin-widget-test.2.diff (4.6 KB) - added by Alex Gaynor 9 years ago.
Refactored methods for simplicty

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by Alex Gaynor

comment:1 Changed 9 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by Alex Gaynor

Keywords: 1.0-blocker added

comment:3 Changed 9 years ago by Malcolm Tredinnick

Those two copies of url_parameters() is a bug waiting to happen (we'll update one and forget the other). Since the second case is in a class that inherits from the first, write a method that does the initial stuff (base_url_parameters()) and then url_parameters() in ForeignKeyRawIdWidget can call that and update the result, whilst url_parameters() in ManyToManyRawIdWidget can just be an alias to base_url_parameters() (or call it and do nothing). That way, you exploit the subclassing and factor out the common code.

Also, you seem to be doing some manual escaping in that string (I know you're only copying earlier code, but if it's a bug, we should fix it). Is it guaranteed that that's the only escaping needed? Can you use Python's query string construction code and then call escape()? I'm wondering whether it's possible to have say a double-quote or a closing angle bracket in the parameter values somehow.

Changed 9 years ago by Alex Gaynor

Refactored methods for simplicty

comment:4 Changed 9 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

Fixed in [8846]

comment:5 Changed 6 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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