summaryrefslogtreecommitdiff
path: root/tests/test_forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_forms.py')
-rw-r--r--tests/test_forms.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_forms.py b/tests/test_forms.py
index 7d37506d..d5710633 100644
--- a/tests/test_forms.py
+++ b/tests/test_forms.py
@@ -1,4 +1,4 @@
-from sleektest import *
+from . sleektest import *
import sleekxmpp.plugins.xep_0004 as xep_0004
@@ -28,11 +28,11 @@ class TestDataForms(SleekTest):
msg = self.Message()
form = msg['form']
- form.addField(var='f1',
- ftype='text-single',
+ form.addField(var='f1',
+ ftype='text-single',
label='Text',
- desc='A text field',
- required=True,
+ desc='A text field',
+ required=True,
value='Some text!')
self.checkMessage(msg, """
@@ -47,8 +47,8 @@ class TestDataForms(SleekTest):
</message>
""")
- form['fields'] = [('f1', {'type': 'text-single',
- 'label': 'Username',
+ form['fields'] = [('f1', {'type': 'text-single',
+ 'label': 'Username',
'required': True}),
('f2', {'type': 'text-private',
'label': 'Password',
@@ -58,7 +58,7 @@ class TestDataForms(SleekTest):
'value': 'Enter message.\nA long one even.'}),
('f4', {'type': 'list-single',
'label': 'Message Type',
- 'options': [{'label': 'Cool!',
+ 'options': [{'label': 'Cool!',
'value': 'cool'},
{'label': 'Urgh!',
'value': 'urgh'}]})]
@@ -89,13 +89,13 @@ class TestDataForms(SleekTest):
def testSetValues(self):
"""Testing setting form values"""
-
+
msg = self.Message()
form = msg['form']
form.setFields([
('foo', {'type': 'text-single'}),
('bar', {'type': 'list-multi'})])
-
+
form.setValues({'foo': 'Foo!',
'bar': ['a', 'b']})