mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #29426 -- Made UUID inputs in the admin match the width of a UUID.
This commit is contained in:
parent
b042ab8976
commit
c832885a3e
4 changed files with 21 additions and 1 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue