Renamed all the is_XXX_needed properties to is_need_XXX. For example, especially the is_offset_needed property to is_need_offset, to be clear and understandable.

This commit is contained in:
2023-03-18 22:52:29 +08:00
parent 98e1bad413
commit 5571c0d01f
21 changed files with 55 additions and 55 deletions

View File

@ -377,7 +377,7 @@ class AccountTestCase(unittest.TestCase):
data={"csrf_token": self.csrf_token,
"base_code": "6172",
"title": stock.title,
"is_offset_needed": "yes"})
"is_need_offset": "yes"})
self.assertEqual(response.status_code, 302)
self.assertEqual(response.headers["Location"], create_uri)
@ -484,7 +484,7 @@ class AccountTestCase(unittest.TestCase):
data={"csrf_token": self.csrf_token,
"base_code": "6172",
"title": stock.title,
"is_offset_needed": "yes"})
"is_need_offset": "yes"})
self.assertEqual(response.status_code, 302)
self.assertEqual(response.headers["Location"], edit_uri)

View File

@ -113,7 +113,7 @@ class OffsetTestCase(unittest.TestCase):
# The original entry does not need offset
with self.app.app_context():
account = Account.find_by_code(Accounts.RECEIVABLE)
account.is_offset_needed = False
account.is_need_offset = False
db.session.commit()
response = self.client.post(store_uri,
data=txn_data.new_form(self.csrf_token))
@ -121,7 +121,7 @@ class OffsetTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], create_uri)
with self.app.app_context():
account = Account.find_by_code(Accounts.RECEIVABLE)
account.is_offset_needed = True
account.is_need_offset = True
db.session.commit()
# The original entry is also an offset
@ -219,7 +219,7 @@ class OffsetTestCase(unittest.TestCase):
# The original entry does not need offset
with self.app.app_context():
account = Account.find_by_code(Accounts.RECEIVABLE)
account.is_offset_needed = False
account.is_need_offset = False
db.session.commit()
response = self.client.post(update_uri,
data=txn_data.update_form(self.csrf_token))
@ -227,7 +227,7 @@ class OffsetTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], edit_uri)
with self.app.app_context():
account = Account.find_by_code(Accounts.RECEIVABLE)
account.is_offset_needed = True
account.is_need_offset = True
db.session.commit()
# The original entry is also an offset
@ -419,7 +419,7 @@ class OffsetTestCase(unittest.TestCase):
# The original entry does not need offset
with self.app.app_context():
account = Account.find_by_code(Accounts.PAYABLE)
account.is_offset_needed = False
account.is_need_offset = False
db.session.commit()
response = self.client.post(store_uri,
data=txn_data.new_form(self.csrf_token))
@ -427,7 +427,7 @@ class OffsetTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], create_uri)
with self.app.app_context():
account = Account.find_by_code(Accounts.PAYABLE)
account.is_offset_needed = True
account.is_need_offset = True
db.session.commit()
# The original entry is also an offset
@ -525,7 +525,7 @@ class OffsetTestCase(unittest.TestCase):
# The original entry does not need offset
with self.app.app_context():
account = Account.find_by_code(Accounts.PAYABLE)
account.is_offset_needed = False
account.is_need_offset = False
db.session.commit()
response = self.client.post(update_uri,
data=txn_data.update_form(self.csrf_token))
@ -533,7 +533,7 @@ class OffsetTestCase(unittest.TestCase):
self.assertEqual(response.headers["Location"], edit_uri)
with self.app.app_context():
account = Account.find_by_code(Accounts.PAYABLE)
account.is_offset_needed = True
account.is_need_offset = True
db.session.commit()
# The original entry is also an offset

View File

@ -152,7 +152,7 @@ class PaginationTestCase(unittest.TestCase):
:param items: All the items in the list.
:param is_reversed: Whether the default page is the last page.
:param result: The expected items on the page.
:param is_paged: Whether the pagination is needed.
:param is_paged: Whether we need pagination.
"""
self.items: list[int] = items
self.is_reversed: bool | None = is_reversed
@ -192,7 +192,7 @@ class PaginationTestCase(unittest.TestCase):
:param query: The query string.
:param items: The original items.
:param result: The expected page content.
:param is_paged: Whether the pagination is needed.
:param is_paged: Whether we need pagination.
:param is_reversed: Whether the list is reversed.
:return: None.
"""