The openstack_dashboard.test.helpers ModuleΒΆ

class openstack_dashboard.test.helpers.APITestCase(methodName='runTest')[source]

Bases: openstack_dashboard.test.helpers.TestCase

The APITestCase class is for use with tests which deal with the underlying clients rather than stubbing out the openstack_dashboard.api.* methods.

APITestCase.setUp()[source]
APITestCase.stub_ceilometerclient()[source]
APITestCase.stub_cinderclient()[source]
APITestCase.stub_glanceclient()[source]
APITestCase.stub_heatclient()[source]
APITestCase.stub_keystoneclient()[source]
APITestCase.stub_neutronclient()[source]
APITestCase.stub_novaclient()[source]
APITestCase.stub_swiftclient(expected_calls=1)[source]
APITestCase.stub_troveclient()[source]
APITestCase.tearDown()[source]
class openstack_dashboard.test.helpers.BaseAdminViewTests(methodName='runTest')[source]

Bases: openstack_dashboard.test.helpers.TestCase

A TestCase subclass which sets an active user with the “admin” role for testing admin-only views and functionality.

BaseAdminViewTests.setActiveUser(*args, **kwargs)[source]
BaseAdminViewTests.setSessionValues(**kwargs)[source]
class openstack_dashboard.test.helpers.PluginTestCase(methodName='runTest')[source]

Bases: openstack_dashboard.test.helpers.TestCase

The PluginTestCase class is for use with tests which deal with the pluggable dashboard and panel configuration, it takes care of backing up and restoring the Horizon configuration.

PluginTestCase.setUp()[source]
PluginTestCase.tearDown()[source]
class openstack_dashboard.test.helpers.RequestFactoryWithMessages(**defaults)[source]

Bases: django.test.client.RequestFactory

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

Bases: openstack_dashboard.test.helpers.SeleniumTestCase

A TestCase subclass which sets an active user with the “admin” role for testing admin-only views and functionality.

SeleniumAdminTestCase.setActiveUser(*args, **kwargs)[source]
class openstack_dashboard.test.helpers.SeleniumTestCase(methodName='runTest')[source]

Bases: horizon.test.helpers.SeleniumTestCase

SeleniumTestCase.setActiveUser(id=None, token=None, username=None, tenant_id=None, service_catalog=None, tenant_name=None, roles=None, authorized_tenants=None, enabled=True)[source]
SeleniumTestCase.setUp()[source]
SeleniumTestCase.tearDown()[source]
class openstack_dashboard.test.helpers.TestCase(methodName='runTest')[source]

Bases: horizon.test.helpers.TestCase

Specialized base test case class for Horizon which gives access to numerous additional features:

  • A full suite of test data through various attached objects and managers (e.g. self.servers, self.user, etc.). See the docs for TestData for more information.
  • The mox mocking framework via self.mox.
  • A set of request context data via self.context.
  • A RequestFactory class which supports Django’s contrib.messages framework via self.factory.
  • A ready-to-go request object via self.request.
  • The ability to override specific time data controls for easier testing.
  • Several handy additional assertion methods.
TestCase.assertFormErrors(response, count=0, message=None, context_name='form')[source]

Asserts that the response does contain a form in its context, and that form has errors, if count were given, it must match the exact numbers of errors

TestCase.assertNoFormErrors(response, context_name='form')[source]

Asserts that the response either does not contain a form in its context, or that if it does, that form has no errors.

TestCase.assertRedirectsNoFollow(response, expected_url)[source]

Asserts that the given response issued a 302 redirect without processing the view which is redirected to.

TestCase.setActiveUser(id=None, token=None, username=None, tenant_id=None, service_catalog=None, tenant_name=None, roles=None, authorized_tenants=None, enabled=True)[source]
TestCase.setUp()[source]
TestCase.tearDown()[source]
openstack_dashboard.test.helpers.create_stubs(stubs_to_create={})[source]
openstack_dashboard.test.helpers.my_custom_sort(flavor)[source]

Previous topic

The openstack_dashboard.test.error_pages_urls Module

Next topic

The openstack_dashboard.test.settings Module

This Page