mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix transaction post_date being set to midnight local.
Reported for Invoices on gnucash-user. Checked all other uses of xaccTransSetPostDateSecs(), fixed the ones that weren't passing an already normalized time64. For Invoices change the post_date to also be normalized so that it stays the same as the transaction post_date. That also protects it from the displayed date changing depending on timezone. The python binding invoice post_time test had to be changed to match.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from unittest import main
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from gnucash import Account, \
|
||||
ACCT_TYPE_RECEIVABLE, ACCT_TYPE_INCOME, ACCT_TYPE_BANK, \
|
||||
@@ -56,8 +56,8 @@ class TestBusiness(BusinessSession):
|
||||
self.assertEqual( NAME, self.employee.GetUsername() )
|
||||
|
||||
def test_post(self):
|
||||
self.assertEqual(self.today - timedelta(0, 0, self.today.microsecond),
|
||||
self.invoice.GetDatePosted())
|
||||
self.assertEqual(datetime.now(timezone.utc).replace(hour=10, minute=59, second=0, microsecond=0).astimezone(),
|
||||
self.invoice.GetDatePosted().astimezone())
|
||||
self.assertTrue( self.invoice.IsPosted() )
|
||||
|
||||
def test_owner(self):
|
||||
|
||||
Reference in New Issue
Block a user