Fix for #18593 (Admin change list swallows unrelated AttributeErrors from callable display fields) #193

Closed
wants to merge 3 commits into
from

Projects

None yet

3 participants

@charettes charettes and 1 other commented on an outdated diff Jul 8, 2012
tests/regressiontests/admin_changelist/tests.py
row_html = '<tbody><tr class="row1"><th><a href="%d/">name</a></th><td class="nowrap">Parent object</td></tr></tbody>' % new_child.id
self.assertFalse(table_output.find(row_html) == -1,
'Failed to find expected row element: %s' % table_output)
+ def test_result_list_errors_propagate(self):
+ """
+ Regression test for #18593: user AttributeErrors from callable
+ display fields should not be swallowed.
@charettes
charettes Jul 8, 2012

Identation typo

@pjdelport
pjdelport Jul 9, 2012

D'oh! Thanks.

pjdelport added some commits Jul 8, 2012
@pjdelport pjdelport Fix and regression test for #18593.
This stops the admin change list from interpreting unrelated
AttributeErrors from user code as empty fields.
744a112
@pjdelport pjdelport Fix a test suite bug that was masked by #18593.
callable_year() now matches model_year() and modeladmin_year().
ff81397
@pjdelport

Updated, without typo.

@aaugustin
Django member

Thanks for your contribution. #357 had pretty much the same solution, but with cleaner tests.

@aaugustin aaugustin closed this Sep 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment