MCPcopy Create free account
hub / github.com/Pylons/webtest / test_radio_input_order

Method test_radio_input_order

tests/test_forms.py:207–233  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

205 self.assertEqual(form.submit_fields(), [('foo', 'fido')])
206
207 def test_radio_input_order(self):
208 app = self.callFUT()
209 res = app.get('/form.html')
210 self.assertEqual(res.status_int, 200)
211 self.assertTrue(res.content_type.startswith('text/html'))
212
213 form = res.forms['complex_radio_input_form']
214 form['foo'].value = 'true'
215 self.assertEqual(form['foo'].value, 'true')
216 self.assertEqual(form['foo'].selectedIndex, 0)
217 self.assertEqual(form.submit_fields(), [
218 ('__start__', 'item:mapping'),
219 ('foo', 'true'),
220 ('__end__', 'item:mapping'),
221 ('__start__', 'item:mapping'),
222 ('__end__', 'item:mapping')])
223
224 res = app.get('/form.html')
225 form = res.forms['complex_radio_input_form']
226 self.assertEqual(form['foo'].value, 'true')
227 self.assertEqual(form['foo'].selectedIndex, 1)
228 self.assertEqual(form.submit_fields(), [
229 ('__start__', 'item:mapping'),
230 ('__end__', 'item:mapping'),
231 ('__start__', 'item:mapping'),
232 ('foo', 'true'),
233 ('__end__', 'item:mapping')])
234
235 def test_input_unicode(self):
236 app = self.callFUT('form_unicode_inputs.html')

Callers

nothing calls this directly

Calls 3

callFUTMethod · 0.95
submit_fieldsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected