Horizon provides a base test case class which provides several useful pre-prepared attributes for testing Horizon components.
Specialized base test case class for Horizon which gives access to numerous additional features:
- The mox mocking framework via self.mox.
- A RequestFactory class which supports Django’s contrib.messages framework via self.factory.
- A ready-to-go request object via self.request.
Asserts that the specified number of messages have been attached for various message types. Usage would look like self.assertMessageCount(success=1).
Asserts that no messages have been attached by the contrib.messages framework.
Asserts that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected), and that text doesn’t occurs in the content of the response.
This is an override of django_test.TestCase.assertNotContains method, which is able to work with StreamingHttpResponse.
The OpenStack Dashboard also provides test case classes for greater ease-of-use when testing APIs and OpenStack-specific auth scenarios.