summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_forms.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index ac96d775a2..d3618b1a8c 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -1903,6 +1903,17 @@ Password: <input type="password" name="password" /></li>
f = SampleForm(data={'name': 'bar'})
self.assertIsInstance(force_text(f['name']), SafeData)
+ def test_custom_boundfield(self):
+ class CustomField(CharField):
+ def get_bound_field(self, form, name):
+ return (form, name)
+
+ class SampleForm(Form):
+ name = CustomField()
+
+ f = SampleForm()
+ self.assertEqual(f['name'], (f, 'name'))
+
def test_initial_datetime_values(self):
now = datetime.datetime.now()
# Nix microseconds (since they should be ignored). #22502