From e7c36ba13a8ce1fa059cfd24cf18b2dd711324da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 25 Feb 2023 17:54:34 +0800 Subject: [PATCH] Revised the type hints in the test_update_not_modified tests of the AccountTestCase and CurrencyTestCase test cases. --- tests/test_account.py | 5 +++-- tests/test_currency.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_account.py b/tests/test_account.py index 81d9088..789f6f2 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -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) diff --git a/tests/test_currency.py b/tests/test_currency.py index a0d2a6c..6708540 100644 --- a/tests/test_currency.py +++ b/tests/test_currency.py @@ -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)