setup_wizard.tests.test_views.test_backup_password_viewsΒΆ

Tests for backup password views in setup_wizard.

ClassesΒΆ

SetupWizardBackupPasswordViewTests

Test cases for SetupWizardBackupPasswordView.

BackupPasswordRecoveryMixinTests

Test cases for BackupPasswordRecoveryMixin.

BackupRestoreViewTests

Test cases for BackupRestoreView.

BackupAutoRestorePasswordViewTests

Test cases for BackupAutoRestorePasswordView.

Module ContentsΒΆ

class setup_wizard.tests.test_views.test_backup_password_views.SetupWizardBackupPasswordViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for SetupWizardBackupPasswordView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_dispatch_not_in_docker()[source]ΒΆ

Test dispatch redirects to login when not in Docker.

Return type:

None

test_dispatch_wrong_state(mock_get_state)[source]ΒΆ

Test dispatch redirects when in wrong state.

Parameters:

mock_get_state (unittest.mock.Mock)

Return type:

None

test_get_context_data(mock_get_state)[source]ΒΆ

Test get_context_data adds password requirements.

Parameters:

mock_get_state (unittest.mock.Mock)

Return type:

None

class setup_wizard.tests.test_views.test_backup_password_views.BackupPasswordRecoveryMixinTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for BackupPasswordRecoveryMixin.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_get_token_for_recovery_no_token(mock_first)[source]ΒΆ

Test _get_token_for_recovery when no token exists.

Parameters:

mock_first (unittest.mock.Mock)

Return type:

None

test_get_token_for_recovery_no_backup(mock_first)[source]ΒΆ

Test _get_token_for_recovery when token has no backup encryption.

Parameters:

mock_first (unittest.mock.Mock)

Return type:

None

test_get_token_for_recovery_success(mock_first)[source]ΒΆ

Test _get_token_for_recovery success.

Parameters:

mock_first (unittest.mock.Mock)

Return type:

None

test_ensure_kek_exists_already_present()[source]ΒΆ

Test _ensure_kek_exists when KEK already exists.

Return type:

None

test_ensure_kek_exists_generate_new()[source]ΒΆ

Test _ensure_kek_exists generates new KEK.

Return type:

None

test_recover_dek_with_password_success()[source]ΒΆ

Test _recover_dek_with_password success.

Return type:

None

test_recover_dek_with_password_invalid()[source]ΒΆ

Test _recover_dek_with_password with invalid password.

Return type:

None

test_wrap_and_save_dek_success()[source]ΒΆ

Test _wrap_and_save_dek success.

Return type:

None

class setup_wizard.tests.test_views.test_backup_password_views.BackupRestoreViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for BackupRestoreView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_view_only_allows_post()[source]ΒΆ

Test that only POST is allowed.

Return type:

None

test_post_invalid_form(mock_call_command, mock_settings)[source]ΒΆ

Test POST with invalid form.

Parameters:
  • mock_call_command (unittest.mock.Mock)

  • mock_settings (unittest.mock.Mock)

Return type:

None

class setup_wizard.tests.test_views.test_backup_password_views.BackupAutoRestorePasswordViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for BackupAutoRestorePasswordView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_dispatch_not_in_docker()[source]ΒΆ

Test dispatch redirects to login when not in Docker.

Return type:

None

test_dispatch_wrong_state(mock_get_state)[source]ΒΆ

Test dispatch redirects when in wrong state.

Parameters:

mock_get_state (unittest.mock.Mock)

Return type:

None