================================================================================ COMMAND EXECUTION HISTORY ================================================================================ Conversation: Requirements Planning Command: python manage.py test tests --verbosity=2 Category: Test Working Directory: /home/cursorai/projects/django-cronjob-utils ================================================================================ EXECUTION - 2025-12-16 06:12:40 ================================================================================ Status: FAILED Exit Code: 1 Execution Time: 4.00 seconds -------------------------------------------------------------------------------- STDOUT -------------------------------------------------------------------------------- Found 157 test(s). Operations to perform: Synchronize unmigrated apps: messages Apply all migrations: admin, auth, contenttypes, django_cronjob_utils, sessions, tests Synchronizing apps without migrations: Creating tables... Running deferred SQL... Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying admin.0003_logentry_add_action_flag_choices... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying auth.0009_alter_user_last_name_max_length... OK Applying auth.0010_alter_group_name_max_length... OK Applying auth.0011_update_proxy_permissions... OK Applying auth.0012_alter_user_first_name_max_length... OK Applying django_cronjob_utils.0001_initial... OK Applying sessions.0001_initial... OK Applying tests.0001_initial... OK System check identified no issues (0 silenced). usage: run_cron_task [-h] [--force] [--rerun] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks] task_name date Run a registered cron task positional arguments: task_name Task name (e.g., calc-commission) date Execution date (YYYY-MM-DD) options: -h, --help show this help message and exit --force Force execution even if already ran --rerun Rerun even if successful --version Show program's version number and exit. -v {0,1,2,3}, --verbosity {0,1,2,3} Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output --settings SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. --pythonpath PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". --traceback Display a full stack trace on CommandError exceptions. --no-color Don't colorize the command output. --force-color Force colorization of the command output. --skip-checks Skip system checks. -------------------------------------------------------------------------------- STDERR -------------------------------------------------------------------------------- Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')... test_create_execution_record (tests.test_base.CronTaskBaseTests.test_create_execution_record) Test creating execution record. ... ok test_execute_dict_return (tests.test_base.CronTaskBaseTests.test_execute_dict_return) Test execute with dict return value. ... ok test_execute_exception_handling (tests.test_base.CronTaskBaseTests.test_execute_exception_handling) Test execute exception handling. ... Task exception-task execution failed: Test exception Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/src/django_cronjob_utils/base.py", line 147, in _execute result = self.execute(self.execution_date) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/tests/test_base.py", line 41, in execute raise ValueError("Test exception") ValueError: Test exception ok test_execute_execution_result_return (tests.test_base.CronTaskBaseTests.test_execute_execution_result_return) Test execute with ExecutionResult return value. ... ok test_execute_with_timeout_no_timeout (tests.test_base.CronTaskBaseTests.test_execute_with_timeout_no_timeout) Test execute_with_timeout without timeout. ... ok test_execute_with_timeout_with_timeout (tests.test_base.CronTaskBaseTests.test_execute_with_timeout_with_timeout) Test execute_with_timeout with timeout. ... ok test_execution_result_creation (tests.test_base.CronTaskBaseTests.test_execution_result_creation) Test ExecutionResult creation. ... ok test_execution_result_defaults (tests.test_base.CronTaskBaseTests.test_execution_result_defaults) Test ExecutionResult default values. ... ok test_get_error_code (tests.test_base.CronTaskBaseTests.test_get_error_code) Test get_error_code method. ... ok test_notify_failure (tests.test_base.CronTaskBaseTests.test_notify_failure) Test notify_failure method. ... ok test_run_concurrent_execution_error (tests.test_base.CronTaskBaseTests.test_run_concurrent_execution_error) Test run method with concurrent execution error. ... FAIL test_run_exception_handling (tests.test_base.CronTaskBaseTests.test_run_exception_handling) Test run method exception handling. ... Task exception-task execution failed: Test exception Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/src/django_cronjob_utils/base.py", line 147, in _execute result = self.execute(self.execution_date) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/tests/test_base.py", line 41, in execute raise ValueError("Test exception") ValueError: Test exception ERROR test_run_failed_execution (tests.test_base.CronTaskBaseTests.test_run_failed_execution) Test run method with failed execution. ... ok test_run_skipped_execution (tests.test_base.CronTaskBaseTests.test_run_skipped_execution) Test run method when execution is skipped. ... ok test_run_successful_execution (tests.test_base.CronTaskBaseTests.test_run_successful_execution) Test run method with successful execution. ... ok test_run_with_retry_on_failure (tests.test_base.CronTaskBaseTests.test_run_with_retry_on_failure) Test run method with retry on failure enabled. ... ok test_run_with_timeout (tests.test_base.CronTaskBaseTests.test_run_with_timeout) Test run method with timeout. ... ok test_schedule_retry (tests.test_base.CronTaskBaseTests.test_schedule_retry) Test schedule_retry method. ... ok test_should_retry_max_retries_reached (tests.test_base.CronTaskBaseTests.test_should_retry_max_retries_reached) Test should_retry when max retries reached. ... ok test_should_retry_no_execution_record (tests.test_base.CronTaskBaseTests.test_should_retry_no_execution_record) Test should_retry when no execution record exists. ... ok test_should_retry_no_retry_enabled (tests.test_base.CronTaskBaseTests.test_should_retry_no_retry_enabled) Test should_retry when retry is disabled. ... ok test_should_retry_within_limit (tests.test_base.CronTaskBaseTests.test_should_retry_within_limit) Test should_retry when within retry limit. ... ok test_should_run_always_pattern (tests.test_base.CronTaskBaseTests.test_should_run_always_pattern) Test should_run with ALWAYS pattern. ... ok test_should_run_force_option (tests.test_base.CronTaskBaseTests.test_should_run_force_option) Test should_run with force option. ... ok test_should_run_rate_limited_pattern (tests.test_base.CronTaskBaseTests.test_should_run_rate_limited_pattern) Test should_run with RATE_LIMITED pattern. ... ok test_should_run_rerun_on_failure_no_previous (tests.test_base.CronTaskBaseTests.test_should_run_rerun_on_failure_no_previous) Test should_run with RERUN_ON_FAILURE pattern when no previous execution. ... ok test_should_run_rerun_on_failure_previous_failure (tests.test_base.CronTaskBaseTests.test_should_run_rerun_on_failure_previous_failure) Test should_run with RERUN_ON_FAILURE pattern when previous failed. ... ok test_should_run_rerun_on_failure_previous_success (tests.test_base.CronTaskBaseTests.test_should_run_rerun_on_failure_previous_success) Test should_run with RERUN_ON_FAILURE pattern when previous succeeded. ... ok test_should_run_rerun_option (tests.test_base.CronTaskBaseTests.test_should_run_rerun_option) Test should_run with rerun option. ... ok test_should_run_standard_pattern_already_executed (tests.test_base.CronTaskBaseTests.test_should_run_standard_pattern_already_executed) Test should_run with STANDARD pattern when already executed. ... ok test_should_run_standard_pattern_not_executed (tests.test_base.CronTaskBaseTests.test_should_run_standard_pattern_not_executed) Test should_run with STANDARD pattern when not executed. ... ok test_task_initialization (tests.test_base.CronTaskBaseTests.test_task_initialization) Test task initialization. ... ok test_task_initialization_with_options (tests.test_base.CronTaskBaseTests.test_task_initialization_with_options) Test task initialization with options. ... ok test_validate_invalid_date (tests.test_base.CronTaskBaseTests.test_validate_invalid_date) Test validation with invalid date type. ... ok test_validate_success (tests.test_base.CronTaskBaseTests.test_validate_success) Test validation with valid date. ... ok test_register_task_all_patterns (tests.test_decorators.DecoratorTests.test_register_task_all_patterns) Test decorator with all execution patterns. ... ok test_register_task_class_inheritance (tests.test_decorators.DecoratorTests.test_register_task_class_inheritance) Test decorator works with class inheritance. ... ok test_register_task_decorator (tests.test_decorators.DecoratorTests.test_register_task_decorator) Test @register_task decorator. ... ok test_register_task_decorator_preserves_class (tests.test_decorators.DecoratorTests.test_register_task_decorator_preserves_class) Test decorator preserves class functionality. ... ok test_register_task_default_config (tests.test_decorators.DecoratorTests.test_register_task_default_config) Test decorator applies default configuration. ... ok test_register_task_duplicate_code (tests.test_decorators.DecoratorTests.test_register_task_duplicate_code) Test decorator raises error on duplicate code. ... ok test_register_task_duplicate_name (tests.test_decorators.DecoratorTests.test_register_task_duplicate_name) Test decorator raises error on duplicate name. ... ok test_register_task_multiple_tasks (tests.test_decorators.DecoratorTests.test_register_task_multiple_tasks) Test registering multiple tasks with decorator. ... ok test_register_task_partial_config (tests.test_decorators.DecoratorTests.test_register_task_partial_config) Test decorator with partial configuration. ... ok test_register_task_retry_config (tests.test_decorators.DecoratorTests.test_register_task_retry_config) Test decorator with retry configuration. ... ok test_register_task_timeout_config (tests.test_decorators.DecoratorTests.test_register_task_timeout_config) Test decorator with timeout configuration. ... ok test_register_task_with_config (tests.test_decorators.DecoratorTests.test_register_task_with_config) Test @register_task with configuration. ... ok test_concurrent_execution_error (tests.test_exceptions.ConcurrentExecutionErrorTests.test_concurrent_execution_error) Test ConcurrentExecutionError with message. ... ok test_concurrent_execution_error_detailed_message (tests.test_exceptions.ConcurrentExecutionErrorTests.test_concurrent_execution_error_detailed_message) Test ConcurrentExecutionError with detailed message. ... ok test_concurrent_execution_error_inheritance (tests.test_exceptions.ConcurrentExecutionErrorTests.test_concurrent_execution_error_inheritance) Test ConcurrentExecutionError inherits from CronJobError. ... ok test_cron_job_error (tests.test_exceptions.CronJobErrorTests.test_cron_job_error) Test CronJobError can be raised. ... ok test_cron_job_error_inheritance (tests.test_exceptions.CronJobErrorTests.test_cron_job_error_inheritance) Test CronJobError is an Exception. ... ok test_cron_job_error_no_message (tests.test_exceptions.CronJobErrorTests.test_cron_job_error_no_message) Test CronJobError without message. ... ok test_task_not_found_error (tests.test_exceptions.TaskNotFoundErrorTests.test_task_not_found_error) Test TaskNotFoundError with message. ... ok test_task_not_found_error_empty_message (tests.test_exceptions.TaskNotFoundErrorTests.test_task_not_found_error_empty_message) Test TaskNotFoundError with empty message. ... ok test_task_not_found_error_inheritance (tests.test_exceptions.TaskNotFoundErrorTests.test_task_not_found_error_inheritance) Test TaskNotFoundError inherits from CronJobError. ... ok test_validation_error (tests.test_exceptions.ValidationErrorTests.test_validation_error) Test ValidationError with message. ... ok test_validation_error_field_specific (tests.test_exceptions.ValidationErrorTests.test_validation_error_field_specific) Test ValidationError with field-specific message. ... ok test_validation_error_inheritance (tests.test_exceptions.ValidationErrorTests.test_validation_error_inheritance) Test ValidationError inherits from CronJobError. ... ok test_lock_acquires_successfully (tests.test_locks.DatabaseLockTests.test_lock_acquires_successfully) Test lock acquires when no running execution exists. ... ok test_lock_allows_completed_execution (tests.test_locks.DatabaseLockTests.test_lock_allows_completed_execution) Test lock allows execution when previous execution is completed. ... ok test_lock_allows_different_execution_date (tests.test_locks.DatabaseLockTests.test_lock_allows_different_execution_date) Test lock allows execution for different execution date. ... ok test_lock_allows_different_task_code (tests.test_locks.DatabaseLockTests.test_lock_allows_different_task_code) Test lock allows execution for different task code. ... ok test_lock_allows_failed_execution (tests.test_locks.DatabaseLockTests.test_lock_allows_failed_execution) Test lock allows execution when previous execution failed. ... ok test_lock_allows_successful_execution (tests.test_locks.DatabaseLockTests.test_lock_allows_successful_execution) Test lock allows execution when previous execution succeeded. ... ok test_lock_edge_case_empty_task_code (tests.test_locks.DatabaseLockTests.test_lock_edge_case_empty_task_code) Test lock with empty task code (edge case). ... ok test_lock_edge_case_future_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_future_date) Test lock with future date (edge case). ... ok test_lock_edge_case_future_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_future_date) Test lock with future date (edge case). ... ERROR test_lock_edge_case_past_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_past_date) Test lock with past date (edge case). ... ok test_lock_edge_case_past_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_past_date) Test lock with past date (edge case). ... ERROR test_lock_multiple_running_executions (tests.test_locks.DatabaseLockTests.test_lock_multiple_running_executions) Test lock detects multiple running executions. ... ok test_lock_multiple_running_executions (tests.test_locks.DatabaseLockTests.test_lock_multiple_running_executions) Test lock detects multiple running executions. ... ERROR test_lock_prevents_concurrent_execution (tests.test_locks.DatabaseLockTests.test_lock_prevents_concurrent_execution) Test lock prevents concurrent execution. ... ok test_lock_prevents_concurrent_execution (tests.test_locks.DatabaseLockTests.test_lock_prevents_concurrent_execution) Test lock prevents concurrent execution. ... ERROR test_lock_released_after_context (tests.test_locks.DatabaseLockTests.test_lock_released_after_context) Test lock is released after context manager exits. ... ok test_lock_select_for_update (tests.test_locks.DatabaseLockTests.test_lock_select_for_update) Test lock uses SELECT FOR UPDATE (indirect test). ... ok test_lock_select_for_update (tests.test_locks.DatabaseLockTests.test_lock_select_for_update) Test lock uses SELECT FOR UPDATE (indirect test). ... ERROR test_lock_within_transaction (tests.test_locks.DatabaseLockTests.test_lock_within_transaction) Test lock works within database transaction. ... ok tearDownClass (tests.test_locks.DatabaseLockTests) ... ERROR test_run_task_concurrent_execution (tests.test_management_command.ManagementCommandTests.test_run_task_concurrent_execution) Test running task when concurrent execution exists. ... FAIL test_run_task_different_dates (tests.test_management_command.ManagementCommandTests.test_run_task_different_dates) Test running task for different dates. ... ok test_run_task_edge_case_future_date (tests.test_management_command.ManagementCommandTests.test_run_task_edge_case_future_date) Test running task with future date (edge case). ... ok test_run_task_edge_case_past_date (tests.test_management_command.ManagementCommandTests.test_run_task_edge_case_past_date) Test running task with past date (edge case). ... ok test_run_task_exception_handling (tests.test_management_command.ManagementCommandTests.test_run_task_exception_handling) Test command handles unexpected exceptions. ... Task exception-task execution failed: Unexpected error Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/src/django_cronjob_utils/base.py", line 147, in _execute result = self.execute(self.execution_date) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 253, in execute raise RuntimeError("Unexpected error") RuntimeError: Unexpected error ERROR test_run_task_failure (tests.test_management_command.ManagementCommandTests.test_run_task_failure) Test running a failing task. ... ERROR test_run_task_force_option (tests.test_management_command.ManagementCommandTests.test_run_task_force_option) Test running task with --force option. ... ok test_run_task_help (tests.test_management_command.ManagementCommandTests.test_run_task_help) Test command help output. ... FAIL test_run_task_invalid_date_format (tests.test_management_command.ManagementCommandTests.test_run_task_invalid_date_format) Test running task with invalid date format. ... ok test_run_task_missing_arguments (tests.test_management_command.ManagementCommandTests.test_run_task_missing_arguments) Test command with missing arguments. ... ERROR test_run_task_not_found (tests.test_management_command.ManagementCommandTests.test_run_task_not_found) Test running a non-existent task. ... ERROR test_run_task_rerun_option (tests.test_management_command.ManagementCommandTests.test_run_task_rerun_option) Test running task with --rerun option. ... ok test_run_task_skipped (tests.test_management_command.ManagementCommandTests.test_run_task_skipped) Test running a task that gets skipped. ... ok test_run_task_success (tests.test_management_command.ManagementCommandTests.test_run_task_success) Test running a successful task. ... ok test_create_execution (tests.test_models.CronExecutionModelTests.test_create_execution) Test creating an execution record. ... ok test_duration_property_completed (tests.test_models.CronExecutionModelTests.test_duration_property_completed) Test duration calculation for completed execution. ... ok test_duration_property_no_started (tests.test_models.CronExecutionModelTests.test_duration_property_no_started) Test duration calculation when started is None (edge case). ... ok test_duration_property_running (tests.test_models.CronExecutionModelTests.test_duration_property_running) Test duration calculation for running execution. ... ok test_empty_task_code (tests.test_models.CronExecutionModelTests.test_empty_task_code) Test execution with empty task code (edge case - should validate). ... ok test_execution_defaults (tests.test_models.CronExecutionModelTests.test_execution_defaults) Test execution record default values. ... ok test_execution_string_representation (tests.test_models.CronExecutionModelTests.test_execution_string_representation) Test execution string representation. ... ok test_future_execution_date (tests.test_models.CronExecutionModelTests.test_future_execution_date) Test execution with future date (edge case). ... ok test_increment_retry (tests.test_models.CronExecutionModelTests.test_increment_retry) Test incrementing retry count. ... ok test_increment_retry_multiple_times (tests.test_models.CronExecutionModelTests.test_increment_retry_multiple_times) Test incrementing retry count multiple times. ... ok test_indexes_exist (tests.test_models.CronExecutionModelTests.test_indexes_exist) Test that database indexes are created (indirect test). ... ok test_long_message (tests.test_models.CronExecutionModelTests.test_long_message) Test execution with very long message (edge case). ... ok test_mark_completed_failure (tests.test_models.CronExecutionModelTests.test_mark_completed_failure) Test marking execution as completed with failure. ... ok test_mark_completed_partial_update (tests.test_models.CronExecutionModelTests.test_mark_completed_partial_update) Test marking completed with partial message/error_code. ... ok test_mark_completed_success (tests.test_models.CronExecutionModelTests.test_mark_completed_success) Test marking execution as completed successfully. ... ok test_mark_failed (tests.test_models.CronExecutionModelTests.test_mark_failed) Test mark_failed convenience method. ... ok test_multiple_executions_same_task_date (tests.test_models.CronExecutionModelTests.test_multiple_executions_same_task_date) Test multiple executions for same task and date. ... ok test_ordering (tests.test_models.CronExecutionModelTests.test_ordering) Test default ordering (most recent first). ... ok test_past_execution_date (tests.test_models.CronExecutionModelTests.test_past_execution_date) Test execution with past date. ... ok test_pid_field (tests.test_models.CronExecutionModelTests.test_pid_field) Test PID field for timeout handling. ... ok test_pid_field_null (tests.test_models.CronExecutionModelTests.test_pid_field_null) Test PID field can be null. ... ok test_special_characters_in_message (tests.test_models.CronExecutionModelTests.test_special_characters_in_message) Test execution with special characters in message. ... ok test_very_long_task_code (tests.test_models.CronExecutionModelTests.test_very_long_task_code) Test execution with very long task code (edge case). ... ok test_very_long_task_name (tests.test_models.CronExecutionModelTests.test_very_long_task_name) Test execution with very long task name (edge case). ... ok test_email_backend_custom_subject_template (tests.test_notifications.EmailBackendTests.test_email_backend_custom_subject_template) Test email backend with custom subject template. ... ok test_email_backend_multiple_recipients (tests.test_notifications.EmailBackendTests.test_email_backend_multiple_recipients) Test email backend with multiple recipients. ... ok test_email_backend_no_recipients (tests.test_notifications.EmailBackendTests.test_email_backend_no_recipients) Test email backend with no recipients. ... Email backend configured but no recipients specified ok test_email_backend_notify_failure (tests.test_notifications.EmailBackendTests.test_email_backend_notify_failure) Test email backend sends failure notification. ... ok test_email_backend_send_failure (tests.test_notifications.EmailBackendTests.test_email_backend_send_failure) Test email backend handles send failure gracefully. ... Failed to send email notification: SMTP error ok test_notify_failure_not_implemented (tests.test_notifications.NotificationBackendTests.test_notify_failure_not_implemented) Test base backend raises NotImplementedError. ... ok test_notify_success_default (tests.test_notifications.NotificationBackendTests.test_notify_success_default) Test base backend notify_success does nothing by default. ... ok test_notification_manager_all_backends (tests.test_notifications.NotificationManagerTests.test_notification_manager_all_backends) Test NotificationManager with all backends. ... ok test_notification_manager_backend_failure_handling (tests.test_notifications.NotificationManagerTests.test_notification_manager_backend_failure_handling) Test NotificationManager handles backend failures gracefully. ... Notification backend EmailBackend failed: Backend error ok test_notification_manager_loads_email_backend (tests.test_notifications.NotificationManagerTests.test_notification_manager_loads_email_backend) Test NotificationManager loads email backend. ... ok test_notification_manager_loads_multiple_backends (tests.test_notifications.NotificationManagerTests.test_notification_manager_loads_multiple_backends) Test NotificationManager loads multiple backends. ... ok test_notification_manager_no_backends (tests.test_notifications.NotificationManagerTests.test_notification_manager_no_backends) Test NotificationManager with no backends configured. ... ok test_notification_manager_notify_failure (tests.test_notifications.NotificationManagerTests.test_notification_manager_notify_failure) Test NotificationManager notifies failure. ... ok test_notification_manager_notify_success (tests.test_notifications.NotificationManagerTests.test_notification_manager_notify_success) Test NotificationManager notifies success when configured. ... ok test_notification_manager_notify_success_not_configured (tests.test_notifications.NotificationManagerTests.test_notification_manager_notify_success_not_configured) Test NotificationManager skips success notification when not configured. ... ok test_slack_backend_defaults (tests.test_notifications.SlackBackendTests.test_slack_backend_defaults) Test SlackBackend default values. ... ok test_slack_backend_init (tests.test_notifications.SlackBackendTests.test_slack_backend_init) Test SlackBackend initialization. ... ok test_slack_backend_init_no_webhook (tests.test_notifications.SlackBackendTests.test_slack_backend_init_no_webhook) Test SlackBackend initialization without webhook raises error. ... ok test_slack_backend_no_requests_library (tests.test_notifications.SlackBackendTests.test_slack_backend_no_requests_library) Test SlackBackend when requests library is not available. ... requests library is required for Slack notifications. Install it with: pip install requests ok test_slack_backend_notify_failure (tests.test_notifications.SlackBackendTests.test_slack_backend_notify_failure) Test SlackBackend sends failure notification. ... ok test_slack_backend_request_failure (tests.test_notifications.SlackBackendTests.test_slack_backend_request_failure) Test SlackBackend handles request failure gracefully. ... Failed to send Slack notification: Network error ok test_telegram_backend_init (tests.test_notifications.TelegramBackendTests.test_telegram_backend_init) Test TelegramBackend initialization. ... ok test_telegram_backend_init_no_chat_id (tests.test_notifications.TelegramBackendTests.test_telegram_backend_init_no_chat_id) Test TelegramBackend initialization without chat_id raises error. ... ok test_telegram_backend_init_no_token (tests.test_notifications.TelegramBackendTests.test_telegram_backend_init_no_token) Test TelegramBackend initialization without token raises error. ... ok test_telegram_backend_long_message (tests.test_notifications.TelegramBackendTests.test_telegram_backend_long_message) Test TelegramBackend truncates very long messages. ... ok test_telegram_backend_no_requests_library (tests.test_notifications.TelegramBackendTests.test_telegram_backend_no_requests_library) Test TelegramBackend when requests library is not available. ... requests library is required for Telegram notifications. Install it with: pip install requests ok test_telegram_backend_notify_failure (tests.test_notifications.TelegramBackendTests.test_telegram_backend_notify_failure) Test TelegramBackend sends failure notification. ... ok test_telegram_backend_request_failure (tests.test_notifications.TelegramBackendTests.test_telegram_backend_request_failure) Test TelegramBackend handles request failure gracefully. ... Failed to send Telegram notification: Network error ok test_code_name_mapping (tests.test_registry.TaskRegistryTests.test_code_name_mapping) Test code to name mapping. ... ok test_empty_registry (tests.test_registry.TaskRegistryTests.test_empty_registry) Test empty registry behavior. ... ok test_get_config (tests.test_registry.TaskRegistryTests.test_get_config) Test getting task configuration. ... ok test_get_config_not_found (tests.test_registry.TaskRegistryTests.test_get_config_not_found) Test getting config for non-existent task. ... ok test_get_task (tests.test_registry.TaskRegistryTests.test_get_task) Test getting task by name. ... ok test_get_task_by_code (tests.test_registry.TaskRegistryTests.test_get_task_by_code) Test getting task by code. ... ok test_get_task_by_code_not_found (tests.test_registry.TaskRegistryTests.test_get_task_by_code_not_found) Test getting task by non-existent code raises error. ... ok test_get_task_not_found (tests.test_registry.TaskRegistryTests.test_get_task_not_found) Test getting non-existent task raises error. ... ok test_is_registered (tests.test_registry.TaskRegistryTests.test_is_registered) Test checking if task is registered. ... ok test_list_tasks (tests.test_registry.TaskRegistryTests.test_list_tasks) Test listing all registered tasks. ... ok test_register_multiple_tasks (tests.test_registry.TaskRegistryTests.test_register_multiple_tasks) Test registering multiple tasks. ... ok test_register_same_class_different_names (tests.test_registry.TaskRegistryTests.test_register_same_class_different_names) Test registering same class with different names/codes. ... ok test_register_task (tests.test_registry.TaskRegistryTests.test_register_task) Test registering a task. ... ok test_register_task_default_config (tests.test_registry.TaskRegistryTests.test_register_task_default_config) Test registering task with default configuration. ... ok test_register_task_duplicate_code (tests.test_registry.TaskRegistryTests.test_register_task_duplicate_code) Test registering duplicate task code raises error. ... ok test_register_task_duplicate_name (tests.test_registry.TaskRegistryTests.test_register_task_duplicate_name) Test registering duplicate task name raises error. ... ok test_register_task_partial_config (tests.test_registry.TaskRegistryTests.test_register_task_partial_config) Test registering task with partial configuration. ... ok test_register_task_with_config (tests.test_registry.TaskRegistryTests.test_register_task_with_config) Test registering a task with configuration. ... ok ====================================================================== ERROR: test_run_exception_handling (tests.test_base.CronTaskBaseTests.test_run_exception_handling) Test run method exception handling. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_base.py", line 377, in test_run_exception_handling execution = CronExecution.objects.get( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/models/query.py", line 639, in get raise self.model.DoesNotExist( django_cronjob_utils.models.CronExecution.DoesNotExist: CronExecution matching query does not exist. ====================================================================== ERROR: test_lock_edge_case_future_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_future_date) Test lock with future date (edge case). ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: test_lock_edge_case_past_date (tests.test_locks.DatabaseLockTests.test_lock_edge_case_past_date) Test lock with past date (edge case). ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: test_lock_multiple_running_executions (tests.test_locks.DatabaseLockTests.test_lock_multiple_running_executions) Test lock detects multiple running executions. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: test_lock_prevents_concurrent_execution (tests.test_locks.DatabaseLockTests.test_lock_prevents_concurrent_execution) Test lock prevents concurrent execution. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: test_lock_select_for_update (tests.test_locks.DatabaseLockTests.test_lock_select_for_update) Test lock uses SELECT FOR UPDATE (indirect test). ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: tearDownClass (tests.test_locks.DatabaseLockTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/transaction.py", line 97, in set_rollback return get_connection(using).set_rollback(rollback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/db/backends/base/base.py", line 507, in set_rollback raise TransactionManagementError( django.db.transaction.TransactionManagementError: The rollback flag doesn't work outside of an 'atomic' block. ====================================================================== ERROR: test_run_task_exception_handling (tests.test_management_command.ManagementCommandTests.test_run_task_exception_handling) Test command handles unexpected exceptions. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 258, in test_run_task_exception_handling exit_code = call_command( ^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 195, in call_command return command.execute(*args, **defaults) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 469, in execute self.stdout.write(output) File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 178, in write if ending and not msg.endswith(ending): ^^^^^^^^^^^^ AttributeError: 'int' object has no attribute 'endswith' ====================================================================== ERROR: test_run_task_failure (tests.test_management_command.ManagementCommandTests.test_run_task_failure) Test running a failing task. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 87, in test_run_task_failure exit_code = call_command( ^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 195, in call_command return command.execute(*args, **defaults) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 469, in execute self.stdout.write(output) File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 178, in write if ending and not msg.endswith(ending): ^^^^^^^^^^^^ AttributeError: 'int' object has no attribute 'endswith' ====================================================================== ERROR: test_run_task_missing_arguments (tests.test_management_command.ManagementCommandTests.test_run_task_missing_arguments) Test command with missing arguments. ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python3.12/argparse.py", line 1943, in parse_known_args namespace, args = self._parse_known_args(args, namespace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/argparse.py", line 2208, in _parse_known_args raise ArgumentError(None, _('the following arguments are required: %s') % argparse.ArgumentError: the following arguments are required: task_name, date During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 340, in test_run_task_missing_arguments call_command('run_cron_task', stdout=out) File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 173, in call_command defaults = parser.parse_args(args=parse_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 68, in parse_args return super().parse_args(args, namespace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/argparse.py", line 1907, in parse_args args, argv = self.parse_known_args(args, namespace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/argparse.py", line 1945, in parse_known_args self.error(str(err)) File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 74, in error raise CommandError("Error: %s" % message) django.core.management.base.CommandError: Error: the following arguments are required: task_name, date ====================================================================== ERROR: test_run_task_not_found (tests.test_management_command.ManagementCommandTests.test_run_task_not_found) Test running a non-existent task. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 112, in test_run_task_not_found exit_code = call_command( ^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 195, in call_command return command.execute(*args, **defaults) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 469, in execute self.stdout.write(output) File "/home/cursorai/projects/django-cronjob-utils/venv/lib/python3.12/site-packages/django/core/management/base.py", line 178, in write if ending and not msg.endswith(ending): ^^^^^^^^^^^^ AttributeError: 'int' object has no attribute 'endswith' ====================================================================== FAIL: test_run_concurrent_execution_error (tests.test_base.CronTaskBaseTests.test_run_concurrent_execution_error) Test run method with concurrent execution error. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_base.py", line 397, in test_run_concurrent_execution_error with self.assertRaises(ConcurrentExecutionError): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: ConcurrentExecutionError not raised ====================================================================== FAIL: test_run_task_concurrent_execution (tests.test_management_command.ManagementCommandTests.test_run_task_concurrent_execution) Test running task when concurrent execution exists. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 241, in test_run_task_concurrent_execution self.assertEqual(exit_code, 2) AssertionError: 0 != 2 ====================================================================== FAIL: test_run_task_help (tests.test_management_command.ManagementCommandTests.test_run_task_help) Test command help output. ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cursorai/projects/django-cronjob-utils/tests/test_management_command.py", line 352, in test_run_task_help self.assertIn('task_name', output) AssertionError: 'task_name' not found in '' ---------------------------------------------------------------------- Ran 157 tests in 2.267s FAILED (failures=3, errors=11) Destroying test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')...