Commands

This package contains tests of the integreat_cms.core.management.commands module

Test Duplicate Pages

tests.core.management.commands.test_duplicate_pages.test_duplicate_pages(settings: SettingsWrapper, load_test_data: None) None[source]

Ensure that pages are really duplicated

Parameters:
  • settings (SettingsWrapper) –

  • load_test_data (None) –

Return type:

None

tests.core.management.commands.test_duplicate_pages.test_duplicate_pages_missing_region_slug(settings: SettingsWrapper) None[source]

Ensure that a missing region slug throws an error

Parameters:

settings (SettingsWrapper) –

Return type:

None

tests.core.management.commands.test_duplicate_pages.test_duplicate_pages_non_existing_region(settings: SettingsWrapper) None[source]

Ensure that a non existing region slug throws an error

Parameters:

settings (SettingsWrapper) –

Return type:

None

tests.core.management.commands.test_duplicate_pages.test_duplicate_pages_prod() None[source]

Ensure that this command does not work in production mode

Return type:

None

Test Find Large Files

tests.core.management.commands.test_find_large_files.test_find_large_files() None[source]

Ensure that finding large files works

Return type:

None

tests.core.management.commands.test_find_large_files.test_find_large_files_exceeding_limit() None[source]

Ensure that a too high limit throws an error

Return type:

None

tests.core.management.commands.test_find_large_files.test_find_large_files_invalid_limit() None[source]

Ensure that a negative limit throws an error

Return type:

None

tests.core.management.commands.test_find_large_files.test_find_large_files_invalid_threshold() None[source]

Ensure that a negative threshold throws an error

Return type:

None

tests.core.management.commands.test_find_large_files.test_find_large_files_valid_limit() None[source]

Ensure that changing the limit works

Return type:

None

tests.core.management.commands.test_find_large_files.test_find_large_files_valid_threshold() None[source]

Ensure that increasing the threshold works

Return type:

None

Test Find Missing Versions

tests.core.management.commands.test_find_missing_versions.test_find_missing_versions_failure(load_test_data: None) None[source]

Ensure that inconsistencies are listed

Parameters:

load_test_data (None) –

Return type:

None

tests.core.management.commands.test_find_missing_versions.test_find_missing_versions_invalid_model() None[source]

Ensure that an invalid model throws an error

Return type:

None

tests.core.management.commands.test_find_missing_versions.test_find_missing_versions_missing_model() None[source]

Ensure that missing model cause an error

Return type:

None

tests.core.management.commands.test_find_missing_versions.test_find_missing_versions_success(load_test_data: None, model: str) None[source]

Ensure no errors are found in default test data

Parameters:
  • load_test_data (None) –

  • model (str) –

Return type:

None

Test Hix Bulk

tests.core.management.commands.test_hix_bulk.test_hix_bulk_bulk_non_existing_region(settings: SettingsWrapper) None[source]

Ensure that a non existing region slug throws an error

Parameters:

settings (SettingsWrapper) –

Return type:

None

tests.core.management.commands.test_hix_bulk.test_hix_bulk_textlab_api_disabled(settings: SettingsWrapper) None[source]

Ensure that a disabled textlab api causes an error

Parameters:

settings (SettingsWrapper) –

Return type:

None

Test Repair Tree

tests.core.management.commands.test_repair_tree.test_check_broken_tree_fields(load_test_data: None) None[source]

Ensure error is found in faulty test data

Parameters:

load_test_data (None) –

Return type:

None

tests.core.management.commands.test_repair_tree.test_check_clean_tree_fields(load_test_data: None) None[source]

Ensure no errors are found in default test data

Parameters:

load_test_data (None) –

Return type:

None

tests.core.management.commands.test_repair_tree.test_fix_broken_tree_fields(load_test_data: None) None[source]

Ensure error is fixed in faulty test data

Parameters:

load_test_data (None) –

Return type:

None

tests.core.management.commands.test_repair_tree.test_fix_clean_tree_fields(load_test_data: None) None[source]

Ensure no errors need to be fixed in default test data

Parameters:

load_test_data (None) –

Return type:

None

Test Reset Deepl Budget

class tests.core.management.commands.test_reset_deepl_budget.datetime_not_first_day[source]

Bases: object

Fake datetime object where now() is never the first day of the month

__init__()[source]
classmethod now() datetime[source]

generate a date with day=2

Returns:

a date which is never the 1st day of the month

Return type:

datetime

tests.core.management.commands.test_reset_deepl_budget.test_not_first_day() None[source]

Ensure that the command will not run when it’s not the 1st day of the month without –force

Return type:

None

tests.core.management.commands.test_reset_deepl_budget.test_reset_mt_budget(load_test_data_transactional: Any | None) None[source]

Ensure that MT budget gets reset successfully

Parameters:

load_test_data_transactional (Any | None) –

Return type:

None

Test Send Push Notifications

tests.core.management.commands.test_send_push_notifications.test_push_notifications_disabled(settings: SettingsWrapper) None[source]

Ensure that disabled push notifications cause an error

Parameters:

settings (SettingsWrapper) –

Return type:

None

tests.core.management.commands.test_send_push_notifications.test_push_notifications_nonexisting_testregion(settings: SettingsWrapper) None[source]

Ensure that an error is caused when the system runs in debug mode but the test region does not exist

Parameters:

settings (SettingsWrapper) –

Return type:

None

Test SUMM.AI Bulk

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_disabled(settings: SettingsWrapper, load_test_data: None) None[source]

Ensure that calling when globally disabled throws an error

Parameters:
  • settings (SettingsWrapper) –

  • load_test_data (None) –

Return type:

None

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_disabled_region(load_test_data: None) None[source]

Ensure that calling when disabled in a region throws an error

Parameters:

load_test_data (None) –

Return type:

None

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_missing_args() None[source]

Ensure that missing args cause an error

Return type:

None

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_missing_username() None[source]

Ensure that a missing username throws an error

Return type:

None

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_non_existing_region() None[source]

Ensure that a non existing region slug throws an error

Return type:

None

tests.core.management.commands.test_summ_ai_bulk.test_summ_ai_bulk_non_existing_username(load_test_data: None) None[source]

Ensure that a non existing username throws an error

Parameters:

load_test_data (None) –

Return type:

None