The horizon.test.helpers ModuleΒΆ

class horizon.test.helpers.RequestFactoryWithMessages(**defaults)[source]

Bases: django.test.client.RequestFactory

RequestFactoryWithMessages.get(*args, **kwargs)[source]
RequestFactoryWithMessages.post(*args, **kwargs)[source]
class horizon.test.helpers.SeleniumTestCase(methodName='runTest')[source]

Bases: django.test.testcases.LiveServerTestCase

SeleniumTestCase.setUp()[source]
classmethod SeleniumTestCase.setUpClass()[source]
classmethod SeleniumTestCase.tearDownClass()[source]
class horizon.test.helpers.TestCase(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

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.
TestCase.assertMessageCount(response=None, **kwargs)[source]

Asserts that the specified number of messages have been attached for various message types. Usage would look like self.assertMessageCount(success=1).

TestCase.assertNoMessages(response=None)[source]

Asserts that no messages have been attached by the contrib.messages framework.

TestCase.setUp()[source]
TestCase.set_permissions(permissions=None)[source]
TestCase.tearDown()[source]

Previous topic

The horizon Module

Next topic

The horizon.test.urls Module

This Page