notifications.tests.test_modelsΒΆ
Tests for the NotificationModel model and related functionality in the notifications app.
AttributesΒΆ
FunctionsΒΆ
|
Test creation of a NotificationModel linked to an Issuing CA. |
|
Test creation of a NotificationModel linked to a domain. |
|
Test translated messages for built-in (non-CUSTOM) notification types. |
|
Test fallback behavior when an unknown message_type is provided. |
|
Test that multiple statuses can be added to a NotificationModel. |
|
Test that __str__ handles missing message (should not raise). |
|
Test that __str__ properly truncates long messages to 20 characters. |
|
Test that __str__ handles empty message description properly. |
|
Test that __str__ handles messages with special characters properly. |
Test notification creation when a new issuing CA is created. |
|
|
Test creation of a NotificationModel linked to a device. |
Test NotificationConfig default values and singleton behavior. |
|
Test that created_at is automatically set when creating a notification. |
|
Test that notifications can be filtered by event. |
|
Test custom notification message with empty descriptions. |
Module ContentsΒΆ
- 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:
test_message (notifications.models.NotificationMessageModel)
test_status (notifications.models.NotificationStatus)
setup_test_issuing_ca (pki.models.CaModel)
- 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:
test_message (notifications.models.NotificationMessageModel)
test_status (notifications.models.NotificationStatus)
test_domain (pki.models.DomainModel)
- 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:
test_message (notifications.models.NotificationMessageModel)
test_domain (pki.models.DomainModel)
- 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:
test_message (notifications.models.NotificationMessageModel)
test_status (notifications.models.NotificationStatus)
setup_test_issuing_ca (pki.models.CaModel)
- 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:
test_message (notifications.models.NotificationMessageModel)
test_status (notifications.models.NotificationStatus)
test_device (devices.models.DeviceModel)
- 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