Skip to content

Commit 1ed2301

Browse files
committed
Add test for placeholder
1 parent 7fd4dbe commit 1ed2301

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

testapp/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TelForm(forms.Form):
99

1010
class TelFormAttrs(forms.Form):
1111
tel_number = forms.CharField(widget=IntlTelInputWidget(
12-
attrs={'title': 'Telephone number'},
12+
attrs={'title': 'Telephone number', 'placeholder': 'foobar'},
1313
preferred_countries=['jp'],
1414
default_code='jp'
1515
))

testapp/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_with_attrs(self):
5050
self.assertIn('data-default-code="jp"', r.content.decode('utf-8'))
5151
self.assertIn('data-preferred-countries="["jp"]"',
5252
r.content.decode('utf-8'))
53+
self.assertIn('placeholder="foobar"', r.content.decode('utf-8'))
5354

5455
def test_with_initial(self):
5556
r = self.client.get('/initial-test/')

0 commit comments

Comments
 (0)