Opened 10 years ago

Closed 10 years ago

#6802 closed (fixed)

NFA: Test for forms changes MEDIA_URL, but it doesn't change it back (may cause test fail)

Reported by: Ales Zoulek Owned by: nobody
Component: Forms Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


/tests/regressiontests/forms/ changes MEDIA_URL to '', but test for admin_widgets is constructed using the old MEDIA_URL.

That may cause error in

 >>> w = AdminFileWidget()
 >>> print conditional_escape(w.render('test', 'test'))
FAIL: Doctest: regressiontests.admin_widgets.models.__test__.WIDGETS_TESTS
Traceback (most recent call last):
  File "/home/al3x/programy/pythonpath/django/test/", line 2180, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for regressiontests.admin_widgets.models.__test__.WIDGETS_TESTS
  File "/home/al3x/programy/django_git/tests/regressiontests/admin_widgets/", line unknown line number, in WIDGETS_TESTS

File "/home/al3x/programy/django_git/tests/regressiontests/admin_widgets/", line ?, in regressiontests.admin_widgets.models.__test__.WIDGETS_TESTS
Failed example:
    print conditional_escape(w.render('test', 'test'))
    Currently: <a target="_blank" href="test">test</a> <br />Change: <input type="file" name="test" />
    Currently: <a target="_blank" href="">test</a> <br />Change: <input type="file" name="test" />


Attachments (1)

forms_media_test.patch (767 bytes) - added by Ales Zoulek 10 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by Brian Rosner

Triage Stage: UnreviewedReady for checkin

Changed 10 years ago by Ales Zoulek

Attachment: forms_media_test.patch added

comment:2 Changed 10 years ago by Ales Zoulek

Has patch: set

comment:3 Changed 10 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

(In [7273]) newforms-admin: Fixed #6802 -- regressiontests/forms/ perserves the MEDIA_URL once finished. Thanks, ales_zoulek.

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