Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Jul 8, 2017
1 parent 6c4c65e commit 66b90a5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions biweeklybudget/tests/unit/flaskapp/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ def test_get_notifications_no_stale(self):
num_stale_accounts=DEFAULT,
budget_account_sum=DEFAULT,
standing_budgets_sum=DEFAULT,
num_unreconciled_ofx=DEFAULT
num_unreconciled_ofx=DEFAULT,
budget_account_unreconciled=DEFAULT,
pp_sum=DEFAULT
) as mocks:
mocks['num_stale_accounts'].return_value = 0
mocks['budget_account_sum'].return_value = 1000
mocks['standing_budgets_sum'].return_value = 1
mocks['num_unreconciled_ofx'].return_value = 0
mocks['budget_account_unreconciled'].return_value = 0
mocks['pp_sum'].return_value = 0
res = NotificationsController.get_notifications()
assert res == []

Expand All @@ -89,12 +93,16 @@ def test_get_notifications_one_stale(self):
num_stale_accounts=DEFAULT,
budget_account_sum=DEFAULT,
standing_budgets_sum=DEFAULT,
num_unreconciled_ofx=DEFAULT
num_unreconciled_ofx=DEFAULT,
budget_account_unreconciled=DEFAULT,
pp_sum=DEFAULT
) as mocks:
mocks['num_stale_accounts'].return_value = 1
mocks['budget_account_sum'].return_value = 1000
mocks['standing_budgets_sum'].return_value = 1
mocks['num_unreconciled_ofx'].return_value = 28
mocks['budget_account_unreconciled'].return_value = 0
mocks['pp_sum'].return_value = 0
res = NotificationsController.get_notifications()
assert res == [
{
Expand All @@ -115,12 +123,16 @@ def test_get_notifications_three_stale(self):
num_stale_accounts=DEFAULT,
budget_account_sum=DEFAULT,
standing_budgets_sum=DEFAULT,
num_unreconciled_ofx=DEFAULT
num_unreconciled_ofx=DEFAULT,
budget_account_unreconciled=DEFAULT,
pp_sum=DEFAULT
) as mocks:
mocks['num_stale_accounts'].return_value = 3
mocks['budget_account_sum'].return_value = 1000
mocks['standing_budgets_sum'].return_value = 1
mocks['num_unreconciled_ofx'].return_value = 28
mocks['budget_account_unreconciled'].return_value = 0
mocks['pp_sum'].return_value = 0
res = NotificationsController.get_notifications()
assert res == [
{
Expand Down

0 comments on commit 66b90a5

Please sign in to comment.