Skip to content

Commit

Permalink
Replace with constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
myersCody committed Apr 29, 2024
1 parent c4eeb42 commit 0576694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion koku/cost_models/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions koku/cost_models/test/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 0576694

Please sign in to comment.