Revised the type hints in the test_update_not_modified tests of the AccountTestCase and CurrencyTestCase test cases.

This commit is contained in:
依瑪貓 2023-02-25 17:54:34 +08:00
parent 4cfe7c7c59
commit e7c36ba13a
2 changed files with 6 additions and 4 deletions

View File

@ -492,6 +492,7 @@ class AccountTestCase(unittest.TestCase):
from accounting.models import Account
detail_uri: str = f"{PREFIX}/{cash.code}"
update_uri: str = f"{PREFIX}/{cash.code}/update"
cash_account: Account
response: httpx.Response
time.sleep(1)
@ -503,7 +504,7 @@ class AccountTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], detail_uri)
with self.app.app_context():
cash_account: Account = Account.find_by_code(cash.code)
cash_account = Account.find_by_code(cash.code)
self.assertIsNotNone(cash_account)
self.assertEqual(cash_account.created_at, cash_account.updated_at)
@ -515,7 +516,7 @@ class AccountTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], detail_uri)
with self.app.app_context():
cash_account: Account = Account.find_by_code(cash.code)
cash_account = Account.find_by_code(cash.code)
self.assertIsNotNone(cash_account)
self.assertLess(cash_account.created_at,
cash_account.updated_at)

View File

@ -438,6 +438,7 @@ class CurrencyTestCase(unittest.TestCase):
from test_site import db
detail_uri: str = f"{PREFIX}/{zza.code}"
update_uri: str = f"{PREFIX}/{zza.code}/update"
zza_currency: Currency
response: httpx.Response
time.sleep(1)
@ -449,7 +450,7 @@ class CurrencyTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], detail_uri)
with self.app.app_context():
zza_currency: Currency = db.session.get(Currency, zza.code)
zza_currency = db.session.get(Currency, zza.code)
self.assertIsNotNone(zza_currency)
self.assertEqual(zza_currency.created_at, zza_currency.updated_at)
@ -461,7 +462,7 @@ class CurrencyTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], detail_uri)
with self.app.app_context():
zza_currency: Currency = db.session.get(Currency, zza.code)
zza_currency = db.session.get(Currency, zza.code)
self.assertIsNotNone(zza_currency)
self.assertLess(zza_currency.created_at,
zza_currency.updated_at)