Skip to content

Commit

Permalink
OM-348: fixing comparing dates
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski committed Oct 22, 2024
1 parent 3119929 commit e8b078c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion worker_voucher/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def resolve_voucher_check(self, info, code):
employer_code=voucher.policyholder.code,
employer_name=voucher.policyholder.trade_name
)
except Exception as e:
except Exception:
raise ValidationError(_("Unable to fetch voucher details"))

@staticmethod
Expand Down
6 changes: 3 additions & 3 deletions worker_voucher/tests/test_gql_voucher_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_get_existed_voucher_by_code(self):
print(query_data)
self.assertEqual(query_data['isExisted'], True)
self.assertEqual(query_data['isValid'], True)
self.assertEqual(query_data['assignedDate'], voucher.assigned_date)
self.assertEqual(query_data['assignedDate'].date(), voucher.assigned_date.date())
self.assertEqual(query_data['employerCode'], voucher.policyholder.code)
self.assertEqual(query_data['employerName'], voucher.policyholder.trade_name)

Expand All @@ -74,7 +74,7 @@ def test_get_existed_voucher_from_tomorrow_by_code(self):
print(query_data)
self.assertEqual(query_data['isExisted'], True)
self.assertEqual(query_data['isValid'], True)
self.assertEqual(query_data['assignedDate'], voucher.assigned_date)
self.assertEqual(query_data['assignedDate'].date(), voucher.assigned_date.date())
self.assertEqual(query_data['employerCode'], voucher.policyholder.code)
self.assertEqual(query_data['employerName'], voucher.policyholder.trade_name)

Expand Down Expand Up @@ -106,7 +106,7 @@ def test_get_existed_voucher_from_yesterday_by_code(self):
print(query_data)
self.assertEqual(query_data['isExisted'], True)
self.assertEqual(query_data['isValid'], False)
self.assertEqual(query_data['assignedDate'], voucher.assigned_date)
self.assertEqual(query_data['assignedDate'].date(), voucher.assigned_date.date())
self.assertEqual(query_data['employerCode'], voucher.policyholder.code)
self.assertEqual(query_data['employerName'], voucher.policyholder.trade_name)

Expand Down

0 comments on commit e8b078c

Please sign in to comment.