Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Jajcus/pyxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacek Konieczny <jajcus@jajcus.net>2005-03-23 23:41:28 +0300
committerJacek Konieczny <jajcus@jajcus.net>2005-03-23 23:41:28 +0300
commit37323e5762e69fdfd161e4bf5765b7f48e44e79a (patch)
treee8c8d225973ca66efed2a1efbeb0dfe9d450d533 /tests
parenta3ea648599858ee6e7e845f03c747847aa26eb43 (diff)
- Form.make_submit() test
Diffstat (limited to 'tests')
-rwxr-xr-xtests/dataforms.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/dataforms.py b/tests/dataforms.py
index a05da7d..8ac085e 100755
--- a/tests/dataforms.py
+++ b/tests/dataforms.py
@@ -56,6 +56,28 @@ class TestForm(unittest.TestCase):
self.check_form_info(form, jep4_example2_info)
self.check_form_iter(form, jep4_example2_fields)
+ def test_jep4_example2_make_submit(self):
+ form = self.parse_form(jep4_example2)
+ form['public'].value = True
+ sform = form.make_submit()
+ self.check_form_info(sform, ("submit", None, None))
+ submitted_fields = [
+ (f[0], None, f[2], None, [], False, None) for f in jep4_example2_fields
+ ]
+ sform['public'].value = None
+ self.check_form_iter(sform, submitted_fields)
+
+ def test_jep4_example2_make_submit_with_types(self):
+ form = self.parse_form(jep4_example2)
+ form['public'].value = True
+ sform = form.make_submit( keep_types = True )
+ self.check_form_info(sform, ("submit", None, None))
+ submitted_fields = [
+ (f[0], f[1], f[2], None, [], False, None) for f in jep4_example2_fields
+ ]
+ sform['public'].value = None
+ self.check_form_iter(sform, submitted_fields)
+
def test_jep4_example3_basic(self):
form = self.parse_form(jep4_example3)
self.check_form_info(form, jep4_example3_info)