Skip to content

Commit

Permalink
اكتمال الاختبارات لنموذج القاموس وقواعد البيانات
Browse files Browse the repository at this point in the history
  • Loading branch information
vzool committed Dec 10, 2024
1 parent 823e0a3 commit 269beca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zakat/zakat_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,8 @@ def _check(self,
print(
f'ref = {ref}, rest = {rest}, record_date = {record_date}, last = {last}, account_id = {account_id}, capital = {capital}, total = {box_total}, count = {count}, desc = {desc}')
exchange = self.exchange(account_id, debug=debug)
if debug:
print(f'exchange <=> {exchange}')
rest = Helper.exchange_calc(rest, float(exchange['rate']), 1)
brief[0] += rest
j = Helper.time_to_milliseconds(record_date)
Expand Down Expand Up @@ -4981,13 +4983,13 @@ def test(self, debug: bool = False) -> bool:
if debug:
print('rate', rate, 'values', values)
for case in [
(a, account_safe_ref, Helper.time_to_milliseconds(Helper.time()) - Helper.TimeCycle(), [
(a, account_safe_ref, Helper.time(Helper.milliseconds_to_datetime(Helper.time_to_milliseconds(Helper.time()) - Helper.TimeCycle())), [
{account_safe_ref: {0: {'below_nisab': x}}},
], False, m),
(b, account_safe_ref, Helper.time_to_milliseconds(Helper.time()) - Helper.TimeCycle(), [
(b, account_safe_ref, Helper.time(Helper.milliseconds_to_datetime(Helper.time_to_milliseconds(Helper.time()) - Helper.TimeCycle())), [
{account_safe_ref: {0: {'count': 1, 'total': y}}},
], True, n),
(c, account_cave_ref, Helper.time_to_milliseconds(Helper.time()) - (Helper.TimeCycle() * 3), [
(c, account_cave_ref, Helper.time(Helper.milliseconds_to_datetime(Helper.time_to_milliseconds(Helper.time()) - (Helper.TimeCycle() * 3))), [
{account_cave_ref: {0: {'count': 3, 'total': z}}},
], True, o),
]:
Expand All @@ -5001,7 +5003,7 @@ def test(self, debug: bool = False) -> bool:
desc='test-check',
account=case[1],
logging=True,
created=Helper.time(Helper.milliseconds_to_datetime(case[2])),
created=case[2],
)
assert self.db.snapshot()

Expand Down

0 comments on commit 269beca

Please sign in to comment.