hawat.test package
Base library for web interface unit tests.
- class hawat.test.HawatTestCase(methodName='runTest')[source]
Bases:
TestCase
Class for testing
hawat.app.Hawat
application.- assertGetURL(url, status_code=200, content_checks=None, print_response=False, follow_redirects=True)[source]
Perform GET request and check some default assertions against the response.
- assertPostURL(url, data, status_code=200, content_checks=None, print_response=False, follow_redirects=True)[source]
Perform POST request and check some default assertions against the response.
- logger = <RootLogger root (DEBUG)>
- class hawat.test.ItemCreateHawatTestCase(methodName='runTest')[source]
Bases:
HawatTestCase
Class for testing
hawat.app.Hawat
application item creation views.- assertCreate(item_model, url, data, content_checks=None, print_response=False)[source]
Perform attempt to create given item.
- maxDiff = None
- class hawat.test.RegistrationHawatTestCase(methodName='runTest')[source]
Bases:
HawatTestCase
Class for testing
hawat.app.Hawat
application registration views.- maxDiff = None
- user_fixture = {'apikey': None, 'email': 'test.user@domain.org', 'enabled': False, 'fullname': 'Test User', 'id': 5, 'locale': None, 'login': 'test', 'logintime': 'None', 'managements': [], 'memberships': [], 'memberships_wanted': [], 'organization': 'TEST, org.', 'roles': ['user'], 'timezone': None}
- hawat.test.app_context_wrapper_decorator(func)[source]
Decorator class for conditional wrapping of given function with application context.