fobi.tests package

Submodules

fobi.tests.base module

class fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest(methodName='runTest')[source]

Bases: django.contrib.staticfiles.testing.StaticLiveServerTestCase

Browser tests django-fobi bulding forms functionality.

Backed up by selenium. This test is based on the bootstrap3 theme.

LIVE_SERVER_URL = None
cleans_up_after_itself = True
reset_sequences = True
classmethod setUpClass()[source]

Set up class.

tearDown()[source]

Tear down.

classmethod tearDownClass()[source]

Tear down class.

fobi.tests.constants module

fobi.tests.core module

fobi.tests.core.print_info(func)[source]

Prints some useful info.

fobi.tests.core.skip(func)[source]

Simply skips the test.

fobi.tests.core.is_app_setup_completed()[source]

Is fobi setup completed?

fobi.tests.core.mark_app_setup_as_completed()[source]

Mark fobi setup as completed.

fobi.tests.data module

fobi.tests.helpers module

fobi.tests.helpers.create_form_with_entries(user=None, create_entries_if_form_exist=True, data={}, is_public=False, name='Test form', slug='test-form')[source]

Create test form with entries.

Fills the form with pre-defined plugins.

Parameters:
  • user (django.contrib.auth.models.User) –
  • create_entries_if_form_exist (bool) – If set to True, entries are being created even if form already exists (a database record).
  • data (dict) –
  • is_public (bool) –
  • name (str) –
  • slug (str) –
Return fobi.models.FormEntry:
 

Instance of fobi.models.FormEntry with a number of form elements and handlers filled in.

fobi.tests.helpers.db_clean_up(clean_form=False, clean_elements=True, clean_handlers=True)[source]

Clean up the database.

Clean up the database by removing all form element and form handler entries.

fobi.tests.helpers.get_or_create_admin_user()[source]

Create a user for testing the fobi.

TODO: At the moment an admin account is being tested. Automated tests with diverse accounts are to be implemented.

fobi.tests.helpers.get_or_create_admin_user()[source]

Create a user for testing the fobi.

TODO: At the moment an admin account is being tested. Automated tests with diverse accounts are to be implemented.

fobi.tests.helpers.phantom_js_clean_up()[source]

Clean up Phantom JS.

Kills all phantomjs instances, disregard of their origin.

fobi.tests.helpers.setup_app(collectstatic=False, fobi_sync_plugins=False)[source]

Set up fobi.

fobi.tests.test_browser_build_dynamic_forms module

class fobi.tests.test_browser_build_dynamic_forms.FobiBrowserBuldDynamicFormsTest(methodName='runTest')[source]

Bases: fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest

Browser tests django-fobi bulding forms functionality.

Backed up by selenium. This test is based on the bootstrap3 theme.

test_1001_open_dashboard(*args, **kwargs)

Inner.

test_2001_add_form(*args, **kwargs)

Inner.

test_2002_edit_form(*args, **kwargs)

Inner.

test_2003_delete_form(*args, **kwargs)

Inner.

test_2004_submit_form(*args, **kwargs)

Inner.

test_3001_add_form_elements(*args, **kwargs)

Inner.

test_3002_remove_form_elements(*args, **kwargs)

Inner.

test_3003_edit_form_elements(*args, **kwargs)

Inner.

test_4001_add_form_handlers(*args, **kwargs)

Inner.

test_4002_remove_form_handlers(*args, **kwargs)

Inner.

test_4003_edit_form_handlers(*args, **kwargs)

Inner.

fobi.tests.test_core module

class fobi.tests.test_core.FobiCoreTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fobi core functionality.

setUp()[source]

Set up.

test_01_get_registered_form_element_plugins(*args, **kwargs)

Inner.

test_02_get_registered_form_handler_plugins(*args, **kwargs)

Inner.

test_03_get_registered_form_callbacks(*args, **kwargs)

Inner.

test_04_get_registered_themes(*args, **kwargs)

Inner.

test_05_action_url(*args, **kwargs)

Inner.

test_06_form_entry_get_absolute_url(*args, **kwargs)

Inner.

test_07_form_wizard_entry_get_absolute_url(*args, **kwargs)

Inner.

test_08_form_entry_is_active(*args, **kwargs)

Inner.

fobi.tests.test_drf_integration module

class fobi.tests.test_drf_integration.FobiDjangoRestFrameworkIntegrationTests(methodName='runTest')[source]

Bases: rest_framework.test.APITestCase

DRF integration tests.

setUp()[source]

Set up.

classmethod setUpTestData()[source]

Load initial data for the TestCase

tearDown()[source]

Set up.

test_01_options_action_public_form()[source]

Test OPTIONS action call for public form.

test_02_put_action_public_form()[source]

Test PUT action call for public form.

test_03_fail_put_action_public_form()[source]

Test PUT action call fail test for public form.

test_04_fail_options_action_non_public_form()[source]

Test OPTIONS action call fail test for non-public form.

test_05_fail_put_action()[source]

Test PUT action call fail test for non-public form.

test_06_options_action_non_public_form_auth_user()[source]

Test OPTIONS action call for authorised user for non-public form.

test_07_put_action_non_public_form_auth_user()[source]

Test PUT action call for authorised user for non-public form.

test_08_get_action_public_form()[source]

Test OPTIONS action call for public form.

test_09_get_action_non_public_form_auth_user()[source]

Test GET action call for authorised user for non-public form.

test_10_fail_get_action_non_public_form()[source]

Test GET action call fail test for non-public form.

fobi.tests.test_dynamic_forms module

class fobi.tests.test_dynamic_forms.FobiDynamicFormsTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fob dynamic forms functionality.

setUp()[source]

Set up.

test_01_assemble_form_class_and_render_form(*args, **kwargs)

Inner.

fobi.tests.test_feincms_integration module

class fobi.tests.test_feincms_integration.FeinCMSIntegrationTest(methodName='runTest')[source]

Bases: fobi.tests.base.BaseFobiBrowserBuldDynamicFormsTest

FeinCMS integration tests.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_fobi_form_widget_public_form()[source]

Test fobi form widget.

fobi.tests.test_form_importers_mailchimp module

class fobi.tests.test_form_importers_mailchimp.FormImportersMailchimpTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of form importers mailchimp functionality.

setUp()[source]

Set up.

test_01_test_mailchimp_importer(*args, **kwargs)

Inner.

fobi.tests.test_sortable_dict module

class fobi.tests.test_sortable_dict.FobiDataStructuresTest(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Tests of django-fobi data_structures module functionality.

setUp()[source]

Set up.

test_01_sortable_dict_move_before_key(*args, **kwargs)

Inner.

test_02_sortable_dict_move_after_key(*args, **kwargs)

Inner.

Module contents