A set simple of BeautifulSoup4 unit test helpers
Project description
Soup Helpers
--------
Examples
>>> assertFormFieldExists(content, 'input', 'my_field')
>>> assertFormFieldExists(content, 'select', 'my_field')
>>> assertFormFieldExists(content, 'textarea', 'my_field')
>>> assertInputValueEquals(content, 'my_field', 'my value')
>>> assertInputValueEquals(content, 'my_field', None)
>>> assertSelectHasOptions(content, 'my_field', ('One', 'Two'))
>>> assertSelectHasSelectedOption(content, 'my_field', 'my selected text')
>>> assertTagWithTextExists(content, 'p', 'some text')
>>> assertTextAreaContainsText(content, 'my_field', 'some textarea text')
--------
Examples
>>> assertFormFieldExists(content, 'input', 'my_field')
>>> assertFormFieldExists(content, 'select', 'my_field')
>>> assertFormFieldExists(content, 'textarea', 'my_field')
>>> assertInputValueEquals(content, 'my_field', 'my value')
>>> assertInputValueEquals(content, 'my_field', None)
>>> assertSelectHasOptions(content, 'my_field', ('One', 'Two'))
>>> assertSelectHasSelectedOption(content, 'my_field', 'my selected text')
>>> assertTagWithTextExists(content, 'p', 'some text')
>>> assertTextAreaContainsText(content, 'my_field', '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.1.zip
(4.3 kB
view hashes)