#8787 closed (fixed)
Tests are currently failing on django trunk
Reported by: | Alex Gaynor | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | 1.0-blocker | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It's the admin_widget tests.
Attachments (2)
Change History (7)
by , 16 years ago
Attachment: | django-admin-widget-test.diff added |
---|
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Keywords: | 1.0-blocker added |
---|
comment:3 by , 16 years ago
by , 16 years ago
Attachment: | django-admin-widget-test.2.diff added |
---|
Refactored methods for simplicty
Note:
See TracTickets
for help on using tickets.
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 thenurl_parameters()
inForeignKeyRawIdWidget
can call that and update the result, whilsturl_parameters()
inManyToManyRawIdWidget
can just be an alias tobase_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.