'Testing range validation setting and getting.'

def test_range_validation(self):

    msg = self.Message()
    form = msg['form']
    field = form.addField(var='f1', ftype='text-single', label='Text', desc='A    text    field', required=True, value='Some    text!')
    validation = field['validate']
    validation.set_range(True, minimum=0, maximum=10)
    self.check(msg, '\n                                        <message>\n                                                <x    xmlns="jabber:x:data"    type="form">\n                                                        <field    var="f1"    type="text-single"    label="Text">\n                                                                <desc>A    text    field</desc>\n                                                                <required    />\n                                                                <value>Some    text!</value>\n                                                                <validate    xmlns="http://jabber.org/protocol/xdata-validate">\n                                                                                <range    min="0"    max="10"    />\n                                                                </validate>\n                                                        </field>\n                                                </x>\n                                        </message>\n                                ')
    self.assertDictEqual(dict(minimum=str(0), maximum=str(10)), validation.get_range())
