Code

Opened 6 years ago

Closed 6 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:

Description

/tests/regressiontests/forms/media.py changes MEDIA_URL to 'http://media.example.com/media/', 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/_doctest.py", 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/models.py", line unknown line number, in WIDGETS_TESTS

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


----------------------------------------------------------------------

Attachments (1)

forms_media_test.patch (767 bytes) - added by ales_zoulek 6 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 years ago by brosner

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

Changed 6 years ago by ales_zoulek

comment:2 Changed 6 years ago by ales_zoulek

  • Has patch set

comment:3 Changed 6 years ago by brosner

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

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

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.