From 05766949a491a8be5052acd3718e5c94e118a2d6 Mon Sep 17 00:00:00 2001 From: myersCody Date: Mon, 29 Apr 2024 12:29:21 -0400 Subject: [PATCH] Replace with constants. --- koku/cost_models/serializers.py | 2 +- koku/cost_models/test/test_serializers.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koku/cost_models/serializers.py b/koku/cost_models/serializers.py index cda5c8e26d..df4cca3003 100644 --- a/koku/cost_models/serializers.py +++ b/koku/cost_models/serializers.py @@ -66,7 +66,7 @@ class DistributionSerializer(BaseSerializer): def validate(self, data): """Run validation for distribution options.""" - default_to_true = ["platform_cost", "worker_cost"] + default_to_true = [metric_constants.PLATFORM_COST, metric_constants.WORKER_UNALLOCATED] distribution_keys = metric_constants.DEFAULT_DISTRIBUTION_INFO.keys() diff = set(distribution_keys).difference(data) if diff == distribution_keys: diff --git a/koku/cost_models/test/test_serializers.py b/koku/cost_models/test/test_serializers.py index 658a377571..49a5ce82c7 100644 --- a/koku/cost_models/test/test_serializers.py +++ b/koku/cost_models/test/test_serializers.py @@ -847,8 +847,8 @@ def test_valid_distribution_info_keys(self): instance = serializer.save() self.assertIsNotNone(instance) # Add in default options - valid_distrib_obj["network_unattributed"] = False - valid_distrib_obj["storage_unattributed"] = False + valid_distrib_obj[metric_constants.NETWORK_UNATTRIBUTED] = False + valid_distrib_obj[metric_constants.STORAGE_UNATTRIBUTED] = False self.assertEqual(instance.distribution_info, valid_distrib_obj) def test_invalid_distribution_info_keys(self):