home.tests.test_viewsΒΆ

Test cases for home app views.

ClassesΒΆ

IndexViewTests

Test cases for IndexView.

DashboardViewTests

Test cases for DashboardView.

NotificationDetailsViewTests

Test cases for NotificationDetailsView.

NotificationMarkSolvedViewTests

Test cases for NotificationMarkSolvedView.

AddDomainsAndDevicesViewTests

Test cases for AddDomainsAndDevicesView.

DashboardChartsAndCountsViewTests

Test cases for DashboardChartsAndCountsView.

Module ContentsΒΆ

class home.tests.test_views.IndexViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for IndexView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_index_redirects_to_dashboard()[source]ΒΆ

Test that IndexView redirects to dashboard.

Return type:

None

class home.tests.test_views.DashboardViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for DashboardView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_generate_last_week_dates()[source]ΒΆ

Test that generate_last_week_dates returns 7 dates.

Return type:

None

test_get_queryset(mock_filter)[source]ΒΆ

Test get_queryset method.

Parameters:

mock_filter (unittest.mock.Mock)

Return type:

None

test_render_created_at_with_new_status()[source]ΒΆ

Test _render_created_at with NEW status.

Return type:

None

test_render_created_at_without_new_status()[source]ΒΆ

Test _render_created_at without NEW status.

Return type:

None

test_render_notification_type_critical()[source]ΒΆ

Test _render_notification_type for CRITICAL notification.

Return type:

None

test_render_notification_type_warning()[source]ΒΆ

Test _render_notification_type for WARNING notification.

Return type:

None

test_render_notification_type_info()[source]ΒΆ

Test _render_notification_type for INFO notification.

Return type:

None

class home.tests.test_views.NotificationDetailsViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for NotificationDetailsView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_get_context_data_removes_new_status(mock_get_or_create)[source]ΒΆ

Test that get_context_data removes NEW status.

Parameters:

mock_get_or_create (unittest.mock.Mock)

Return type:

None

test_get_context_data_is_solved_true(mock_get_or_create)[source]ΒΆ

Test that get_context_data sets is_solved to True when solved status present.

Parameters:

mock_get_or_create (unittest.mock.Mock)

Return type:

None

class home.tests.test_views.NotificationMarkSolvedViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for NotificationMarkSolvedView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_get_context_data_adds_solved_status(mock_get_or_create)[source]ΒΆ

Test that get_context_data adds SOLVED status.

Parameters:

mock_get_or_create (unittest.mock.Mock)

Return type:

None

class home.tests.test_views.AddDomainsAndDevicesViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for AddDomainsAndDevicesView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_get_success(mock_redirect, mock_add_message, mock_call_command)[source]ΒΆ

Test successful execution of add_domains_and_devices command.

Parameters:
  • mock_redirect (unittest.mock.Mock)

  • mock_add_message (unittest.mock.Mock)

  • mock_call_command (unittest.mock.Mock)

Return type:

None

test_get_command_error(mock_redirect, mock_add_message, mock_call_command)[source]ΒΆ

Test handling of CommandError.

Parameters:
  • mock_redirect (unittest.mock.Mock)

  • mock_add_message (unittest.mock.Mock)

  • mock_call_command (unittest.mock.Mock)

Return type:

None

class home.tests.test_views.DashboardChartsAndCountsViewTests(methodName='runTest')[source]ΒΆ

Bases: django.test.TestCase

Test cases for DashboardChartsAndCountsView.

setUp()[source]ΒΆ

Set up test fixtures.

Return type:

None

test_get_with_invalid_date_format()[source]ΒΆ

Test GET with invalid date format.

Return type:

None

test_get_success(mock_issuing_ca, mock_cert_counts, mock_device_counts)[source]ΒΆ

Test successful GET request.

Parameters:
  • mock_issuing_ca (unittest.mock.Mock)

  • mock_cert_counts (unittest.mock.Mock)

  • mock_device_counts (unittest.mock.Mock)

Return type:

None

test_get_device_count_by_onboarding_status()[source]ΒΆ

Test get_device_count_by_onboarding_status method.

Return type:

None

test_get_cert_counts()[source]ΒΆ

Test get_cert_counts method.

Return type:

None

test_get_issuing_ca_counts()[source]ΒΆ

Test get_issuing_ca_counts method.

Return type:

None

test_get_expiring_device_counts()[source]ΒΆ

Test get_expiring_device_counts method.

Return type:

None

test_get_expired_device_counts()[source]ΒΆ

Test get_expired_device_counts method.

Return type:

None

test_get_expiring_issuing_ca_counts()[source]ΒΆ

Test get_expiring_issuing_ca_counts method.

Return type:

None

test_get_device_count_by_onboarding_protocol()[source]ΒΆ

Test get_device_count_by_onboarding_protocol method.

Return type:

None

test_get_device_count_by_domain()[source]ΒΆ

Test get_device_count_by_domain method.

Return type:

None

test_get_cert_counts_by_status()[source]ΒΆ

Test get_cert_counts_by_status method.

Return type:

None

test_get_cert_counts_by_issuing_ca()[source]ΒΆ

Test get_cert_counts_by_issuing_ca method.

Return type:

None

test_get_cert_counts_by_domain()[source]ΒΆ

Test get_cert_counts_by_domain method.

Return type:

None

test_get_cert_counts_by_profile()[source]ΒΆ

Test get_cert_counts_by_profile method.

Return type:

None

test_get_issuing_ca_counts_by_type()[source]ΒΆ

Test get_issuing_ca_counts_by_type method.

Return type:

None

test_get_device_charts_data(mock_domain, mock_protocol, mock_status)[source]ΒΆ

Test get_device_charts_data method.

Parameters:
  • mock_domain (unittest.mock.Mock)

  • mock_protocol (unittest.mock.Mock)

  • mock_status (unittest.mock.Mock)

Return type:

None

test_get_cert_charts_data(mock_profile, mock_domain, mock_status)[source]ΒΆ

Test get_cert_charts_data method.

Parameters:
  • mock_profile (unittest.mock.Mock)

  • mock_domain (unittest.mock.Mock)

  • mock_status (unittest.mock.Mock)

Return type:

None

test_get_ca_charts_data(mock_type, mock_ca_date, mock_ca)[source]ΒΆ

Test get_ca_charts_data method.

Parameters:
  • mock_type (unittest.mock.Mock)

  • mock_ca_date (unittest.mock.Mock)

  • mock_ca (unittest.mock.Mock)

Return type:

None