-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: send geag terms acceptd at in correct format
- Loading branch information
1 parent
9d7f1ef
commit 838c63f
Showing
2 changed files
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
""" | ||
Tests for the admin module. | ||
""" | ||
from datetime import date | ||
from datetime import date, datetime | ||
from unittest import mock | ||
|
||
from django.contrib.admin.sites import AdminSite | ||
from django.test import TestCase | ||
|
||
from ...core.tests.factories import UserFactory | ||
from ..admin import ForcedPolicyRedemptionAdmin, ForcedPolicyRedemptionForm | ||
from ..admin import GEAG_DATETIME_FMT, ForcedPolicyRedemptionAdmin, ForcedPolicyRedemptionForm | ||
from ..models import ForcedPolicyRedemption | ||
|
||
|
||
|
@@ -52,3 +52,9 @@ def test_force_redeem_with_extra_metadata(self): | |
'geag_email': '[email protected]', | ||
} | ||
) | ||
terms_accepted_value =\ | ||
forced_redemption_obj.force_redeem.call_args_list[0][1]['extra_metadata']['geag_terms_accepted_at'] | ||
# we don't really care about the value, but | ||
# we want to know that parsing the value matches the datetime | ||
# format accepted by GEAG. | ||
assert datetime.strptime(terms_accepted_value, GEAG_DATETIME_FMT) |