Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#8787 closed (fixed)

Tests are currently failing on django trunk

Reported by: Alex 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:

Description

It's the admin_widget tests.

Attachments (2)

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

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Alex

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by Alex

  • Keywords 1.0-blocker added

comment:3 Changed 6 years ago by mtredinnick

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 6 years ago by Alex

Refactored methods for simplicty

comment:4 Changed 6 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [8846]

comment:5 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.