notifications.tests.test_modelsΒΆ

Tests for the NotificationModel model and related functionality in the notifications app.

AttributesΒΆ

FunctionsΒΆ

test_create_notification_with_issuing_ca(test_message, ...)

Test creation of a NotificationModel linked to an Issuing CA.

test_create_notification_with_domain(test_message, ...)

Test creation of a NotificationModel linked to a domain.

test_notification_translations_for_builtins(test_status)

Test translated messages for built-in (non-CUSTOM) notification types.

test_unknown_message_type_fallback(test_status)

Test fallback behavior when an unknown message_type is provided.

test_notification_with_multiple_statuses(test_message, ...)

Test that multiple statuses can be added to a NotificationModel.

test_notification_str_fallback_missing_message(test_domain)

Test that __str__ handles missing message (should not raise).

test_notification_str_with_long_message(test_domain)

Test that __str__ properly truncates long messages to 20 characters.

test_notification_str_with_empty_message(test_domain)

Test that __str__ handles empty message description properly.

test_notification_str_with_special_characters(test_domain)

Test that __str__ handles messages with special characters properly.

test_notification_for_issuing_ca_creation(...)

Test notification creation when a new issuing CA is created.

test_create_notification_with_device(test_message, ...)

Test creation of a NotificationModel linked to a device.

test_notification_config_defaults()

Test NotificationConfig default values and singleton behavior.

test_notification_created_at_auto_now()

Test that created_at is automatically set when creating a notification.

test_notification_event_filtering()

Test that notifications can be filtered by event.

test_custom_message_with_empty_descriptions()

Test custom notification message with empty descriptions.

Module ContentsΒΆ

notifications.tests.test_models.DEFAULT_EXPIRY_WARNING_DAYS = 30[source]ΒΆ
notifications.tests.test_models.DEFAULT_RSA_KEY_SIZE = 2048[source]ΒΆ
notifications.tests.test_models.EXPECTED_STATUS_COUNT = 2[source]ΒΆ
notifications.tests.test_models.test_create_notification_with_issuing_ca(test_message, test_status, setup_test_issuing_ca)[source]ΒΆ

Test creation of a NotificationModel linked to an Issuing CA.

Parameters:
Return type:

None

notifications.tests.test_models.test_create_notification_with_domain(test_message, test_status, test_domain)[source]ΒΆ

Test creation of a NotificationModel linked to a domain.

Parameters:
Return type:

None

notifications.tests.test_models.test_notification_translations_for_builtins(test_status)[source]ΒΆ

Test translated messages for built-in (non-CUSTOM) notification types.

Parameters:

test_status (notifications.models.NotificationStatus)

Return type:

None

notifications.tests.test_models.test_unknown_message_type_fallback(test_status)[source]ΒΆ

Test fallback behavior when an unknown message_type is provided.

Parameters:

test_status (notifications.models.NotificationStatus)

Return type:

None

notifications.tests.test_models.test_notification_with_multiple_statuses(test_message, test_domain)[source]ΒΆ

Test that multiple statuses can be added to a NotificationModel.

Parameters:
Return type:

None

notifications.tests.test_models.test_notification_str_fallback_missing_message(test_domain)[source]ΒΆ

Test that __str__ handles missing message (should not raise).

Parameters:

test_domain (pki.models.DomainModel)

Return type:

None

notifications.tests.test_models.test_notification_str_with_long_message(test_domain)[source]ΒΆ

Test that __str__ properly truncates long messages to 20 characters.

Parameters:

test_domain (pki.models.DomainModel)

Return type:

None

notifications.tests.test_models.test_notification_str_with_empty_message(test_domain)[source]ΒΆ

Test that __str__ handles empty message description properly.

Parameters:

test_domain (pki.models.DomainModel)

Return type:

None

notifications.tests.test_models.test_notification_str_with_special_characters(test_domain)[source]ΒΆ

Test that __str__ handles messages with special characters properly.

Parameters:

test_domain (pki.models.DomainModel)

Return type:

None

notifications.tests.test_models.test_notification_for_issuing_ca_creation(test_message, test_status, setup_test_issuing_ca)[source]ΒΆ

Test notification creation when a new issuing CA is created.

Parameters:
Return type:

None

notifications.tests.test_models.test_create_notification_with_device(test_message, test_status, test_device)[source]ΒΆ

Test creation of a NotificationModel linked to a device.

Parameters:
Return type:

None

notifications.tests.test_models.test_notification_config_defaults()[source]ΒΆ

Test NotificationConfig default values and singleton behavior.

Return type:

None

notifications.tests.test_models.test_notification_created_at_auto_now()[source]ΒΆ

Test that created_at is automatically set when creating a notification.

Return type:

None

notifications.tests.test_models.test_notification_event_filtering()[source]ΒΆ

Test that notifications can be filtered by event.

Return type:

None

notifications.tests.test_models.test_custom_message_with_empty_descriptions()[source]ΒΆ

Test custom notification message with empty descriptions.

Return type:

None