From 4c72fb560e0f01b4beba3d28d812bc8c0ecf0064 Mon Sep 17 00:00:00 2001 From: JJtan <95962077+JJtan2002@users.noreply.github.com> Date: Sun, 30 Jun 2024 10:41:53 +0800 Subject: [PATCH] Fix tests.py --- backend/budget_tracking/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/budget_tracking/tests.py b/backend/budget_tracking/tests.py index 3ce20bf..865daa1 100644 --- a/backend/budget_tracking/tests.py +++ b/backend/budget_tracking/tests.py @@ -45,7 +45,7 @@ def test_recurrent_transaction(self): def test_get_monthly_earnings(self): one_month_ago = datetime.datetime.today() - relativedelta(months=1) out_of_range = one_month_ago - relativedelta(days=1) - in_range = datetime.datetime.today() - relativedelta(days=1) + in_range = datetime.datetime.today() earnings_in_range = self.factory.create_transaction_filled(self.wallet, type="Earning", value=150) earning_in_range2 = self.factory.create_transaction_filled(self.wallet, type="Earning", value=50, date=in_range) @@ -65,7 +65,7 @@ def test_get_monthly_earnings(self): def test_get_monthly_expenses(self): one_month_ago = datetime.datetime.today() - relativedelta(months=1) out_of_range = one_month_ago - relativedelta(days=1) - in_range = datetime.datetime.today() + relativedelta(days=1) + in_range = datetime.datetime.today() expense_in_range = self.factory.create_transaction_filled(self.wallet, type="Expense", value=150) expense_in_range2 = self.factory.create_transaction_filled(self.wallet, type="Expense", value=50, date=in_range) @@ -78,4 +78,4 @@ def test_get_monthly_expenses(self): expected_value = 200 monthly_earning = self.wallet.get_monthly_expenses() - self.assertEqual(expected_value, monthly_earning) \ No newline at end of file + self.assertEqual(expected_value, monthly_earning)