Modified wrong expected ClearableFileInput rendering output in a couple of additional tests after fix introduced in [15426]. Refs #14984.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15432 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales 2011-02-05 20:06:49 +00:00
parent 0b8b60caca
commit accee3961c
2 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ class AdminFileWidgetTest(DjangoTestCase):
w = AdminFileWidget()
self.assertEqual(
conditional_escape(w.render('test', album.cover_art)),
'<p class="file-upload">Currently: <a target="_blank" href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % { 'STORAGE_URL': default_storage.url('') },
'<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>' % { 'STORAGE_URL': default_storage.url('') },
)
self.assertEqual(

View File

@ -1084,7 +1084,7 @@ class ClearableFileInputTests(TestCase):
widget = ClearableFileInput()
widget.is_required = False
self.assertEqual(widget.render('myfile', FakeFieldFile()),
u'Currently: <a target="_blank" href="something">something</a> <input type="checkbox" name="myfile-clear" id="myfile-clear_id" /> <label for="myfile-clear_id">Clear</label><br />Change: <input type="file" name="myfile" />')
u'Currently: <a href="something">something</a> <input type="checkbox" name="myfile-clear" id="myfile-clear_id" /> <label for="myfile-clear_id">Clear</label><br />Change: <input type="file" name="myfile" />')
def test_clear_input_renders_only_if_not_required(self):
"""
@ -1095,7 +1095,7 @@ class ClearableFileInputTests(TestCase):
widget = ClearableFileInput()
widget.is_required = True
self.assertEqual(widget.render('myfile', FakeFieldFile()),
u'Currently: <a target="_blank" href="something">something</a> <br />Change: <input type="file" name="myfile" />')
u'Currently: <a href="something">something</a> <br />Change: <input type="file" name="myfile" />')
def test_clear_input_renders_only_if_initial(self):
"""