summaryrefslogtreecommitdiff
path: root/tests/admin_widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_widgets')
-rw-r--r--tests/admin_widgets/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index f9c6d6a614..2e2bdb0b52 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -434,6 +434,18 @@ class AdminFileWidgetTests(TestDataMixin, TestCase):
'<input type="file" name="test" />',
)
+ def test_render_required(self):
+ widget = widgets.AdminFileWidget()
+ widget.is_required = True
+ self.assertHTMLEqual(
+ widget.render('test', self.album.cover_art),
+ '<p class="file-upload">Currently: <a href="%(STORAGE_URL)salbums/'
+ r'hybrid_theory.jpg">albums\hybrid_theory.jpg</a><br />'
+ 'Change: <input type="file" name="test" /></p>' % {
+ 'STORAGE_URL': default_storage.url(''),
+ },
+ )
+
def test_readonly_fields(self):
"""
File widgets should render as a link when they're marked "read only."