Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested billtype changes #1302

Merged
merged 5 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions ihatemoney/tests/budget_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,18 +717,6 @@ def test_manage_bills(self):
},
)

# transfer bill should not affect balances at all
self.client.post(
"/raclette/add",
data={
"date": "2011-08-10",
"what": "Transfer",
"payer": members_ids[1],
"payed_for": members_ids[0],
"bill_type": "Transfer",
"amount": "500",
},
)
balance = self.get_project("raclette").balance
assert set(balance.values()) == set([19.0, -19.0])

Expand Down Expand Up @@ -843,40 +831,6 @@ def test_reimbursement_bill(self):
assert bob_paid == 500
assert alice_paid == 500

def test_transfer_bill(self):
self.post_project("random")

# add two participants
self.client.post("/random/members/add", data={"name": "zorglub"})
self.client.post("/random/members/add", data={"name": "fred"})

members_ids = [m.id for m in self.get_project("random").members]
self.client.post(
"/random/add",
data={
"date": "2022-10-10",
"what": "Rent",
"payer": members_ids[0], # zorglub
"payed_for": members_ids, # zorglub + fred
"bill_type": "Expense",
"amount": "1000",
},
)
# test transfer bill (should not affect anything whatsoever)
self.client.post(
"/random/add",
data={
"date": "2022-10-10",
"what": "Transfer of 500 to fred",
"payer": members_ids[0], # zorglub
"payed_for": members_ids[1], # fred
"bill_type": "Transfer",
"amount": "500",
},
)
balance = self.get_project("random").balance
assert set(balance.values()), set([500 == -500])

def test_weighted_balance(self):
self.post_project("raclette")

Expand Down
2 changes: 1 addition & 1 deletion ihatemoney/tests/import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def test_export_with_currencies(self):
},
{
"date": "2016-12-31",
"what": "\xe0 raclette",
"what": "fromage \xe0 raclette",
"bill_type": "Expense",
"amount": 10.0,
"currency": "EUR",
Expand Down
2 changes: 0 additions & 2 deletions ihatemoney/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,6 @@ def settle_bill():

@main.route("/<project_id>/settle/<amount>/<int:ower_id>/<int:payer_id>")
def settle(amount, ower_id, payer_id):
# FIXME: Test this bill belongs to this project !

new_reinbursement = Bill(
amount=float(amount),
date=datetime.datetime.today(),
Expand Down
Loading