diff --git a/awx/main/tests/functional/commands/test_cleanup_facts.py b/awx/main/tests/functional/commands/test_cleanup_facts.py index d741b58302..93aec40928 100644 --- a/awx/main/tests/functional/commands/test_cleanup_facts.py +++ b/awx/main/tests/functional/commands/test_cleanup_facts.py @@ -15,6 +15,9 @@ from awx.main.management.commands.cleanup_facts import CleanupFacts, Command from awx.main.models.fact import Fact from awx.main.models.inventory import Host +def mock_feature_enabled(feature, bypass_database=None): + return True + @pytest.mark.django_db def test_cleanup_granularity(fact_scans, hosts): epoch = timezone.now() @@ -88,6 +91,7 @@ def test_cleanup_logic(fact_scans, hosts): timestamp_pivot -= granularity assert fact.timestamp == timestamp_pivot +@mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled) @pytest.mark.django_db def test_parameters_ok(mocker): run = mocker.patch('awx.main.management.commands.cleanup_facts.CleanupFacts.run') @@ -158,6 +162,7 @@ def test_string_time_to_timestamp_invalid(): res = cmd.string_time_to_timestamp(kv['time']) assert res is None +@mock.patch('awx.api.views.feature_enabled', new=mock_feature_enabled) @pytest.mark.django_db def test_parameters_fail(mocker): # Mock run() just in case, but it should never get called because an error should be thrown