summaryrefslogtreecommitdiff
path: root/tests/admin_widgets
diff options
context:
space:
mode:
authormackong <mackonghp@gmail.com>2018-08-18 22:16:22 +0800
committerTim Graham <timograham@gmail.com>2018-08-18 10:16:22 -0400
commitc832885a3e8659d4a704bf103d523b610c24e4ec (patch)
treea5152df7b70a72ba611f79c7ac045223261c6d29 /tests/admin_widgets
parentb042ab897636987701d3a35d6b566c6bef9d6ea2 (diff)
downloaddjango-c832885a3e8659d4a704bf103d523b610c24e4ec.tar.gz
Fixed #29426 -- Made UUID inputs in the admin match the width of a UUID.
Diffstat (limited to 'tests/admin_widgets')
-rw-r--r--tests/admin_widgets/tests.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index 43cf9f4182..f7c2a7865c 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -408,6 +408,20 @@ class AdminURLWidgetTest(SimpleTestCase):
)
+class AdminUUIDWidgetTests(SimpleTestCase):
+ def test_attrs(self):
+ w = widgets.AdminUUIDInputWidget()
+ self.assertHTMLEqual(
+ w.render('test', '550e8400-e29b-41d4-a716-446655440000'),
+ '<input value="550e8400-e29b-41d4-a716-446655440000" type="text" class="vUUIDField" name="test">',
+ )
+ w = widgets.AdminUUIDInputWidget(attrs={'class': 'myUUIDInput'})
+ self.assertHTMLEqual(
+ w.render('test', '550e8400-e29b-41d4-a716-446655440000'),
+ '<input value="550e8400-e29b-41d4-a716-446655440000" type="text" class="myUUIDInput" name="test">',
+ )
+
+
@override_settings(ROOT_URLCONF='admin_widgets.urls')
class AdminFileWidgetTests(TestDataMixin, TestCase):