A set simple of BeautifulSoup4 unit test helpers
Project description
Soup Helpers
--------
Examples
>>> assertFormFieldExists(content, tag='input', field_name='my_field')
>>> assertFormFieldExists(content, tag='select', field_name='my_field')
>>> assertFormFieldExists(content, tag='textarea', field_name='my_field')
>>> assertInputValueEquals(content, field_name='my_field', value='my value')
>>> assertInputValueEquals(content, field_name='my_field', value=None)
>>> assertSelectHasOptions(content, field_name='my_field', options_tuple=('One', 'Two'))
>>> assertSelectHasSelectedOption(content, field_name='my_field', text='my selected text')
>>> assertTagWithTextExists(content, tag='p', text='some text')
>>> assertTextAreaContainsText(content, field_name='my_field', text='some textarea text')
--------
Examples
>>> assertFormFieldExists(content, tag='input', field_name='my_field')
>>> assertFormFieldExists(content, tag='select', field_name='my_field')
>>> assertFormFieldExists(content, tag='textarea', field_name='my_field')
>>> assertInputValueEquals(content, field_name='my_field', value='my value')
>>> assertInputValueEquals(content, field_name='my_field', value=None)
>>> assertSelectHasOptions(content, field_name='my_field', options_tuple=('One', 'Two'))
>>> assertSelectHasSelectedOption(content, field_name='my_field', text='my selected text')
>>> assertTagWithTextExists(content, tag='p', text='some text')
>>> assertTextAreaContainsText(content, field_name='my_field', text='some textarea text')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
soup_helpers-0.0.2.zip
(4.4 kB
view hashes)