Skip to content

Commit

Permalink
feat: add created date to subsidy serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed Sep 16, 2024
1 parent 4099cbf commit 92d8a2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion enterprise_subsidy/apps/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class Meta:
"internal_only",
"revenue_category",
"is_active",
"total_deposits"
"total_deposits",
"created",
"modified",
# In the MVP implementation, there are only learner_credit subsidies. Uncomment after subscription
# subsidies are introduced.
# "subsidy_type",
Expand Down
6 changes: 6 additions & 0 deletions enterprise_subsidy/apps/api/v1/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ def test_get_one_subsidy(self):
"revenue_category": RevenueCategoryChoices.BULK_ENROLLMENT_PREPAY,
"is_active": True,
"total_deposits": self.subsidy_1.starting_balance,
"created": self.subsidy_1.created.strftime(SERIALIZED_DATE_PATTERN),
"modified": self.subsidy_1.modified.strftime(SERIALIZED_DATE_PATTERN),
}
self.assertEqual(expected_result, response.json())

Expand Down Expand Up @@ -275,6 +277,8 @@ def test_get_adjustments_related_subsidy(self):
"revenue_category": RevenueCategoryChoices.BULK_ENROLLMENT_PREPAY,
"is_active": True,
"total_deposits": self.subsidy_5.total_deposits,
"created": self.subsidy_5.created.strftime(SERIALIZED_DATE_PATTERN),
"modified": self.subsidy_5.modified.strftime(SERIALIZED_DATE_PATTERN),
}
total_deposits_including_positive_adjustment = sum(
[self.subsidy_5.starting_balance, APITestBase.adjustment_quantity_1]
Expand Down Expand Up @@ -313,6 +317,8 @@ def test_get_adjustments_related_subsidy(self):
"revenue_category": RevenueCategoryChoices.BULK_ENROLLMENT_PREPAY,
"is_active": True,
"total_deposits": self.subsidy_5.total_deposits,
"created": self.subsidy_5.created.strftime(SERIALIZED_DATE_PATTERN),
"modified": self.subsidy_5.modified.strftime(SERIALIZED_DATE_PATTERN),
}

total_deposits_including_negative_adjustment = sum(
Expand Down

0 comments on commit 92d8a2f

Please sign in to comment.