Skip to content

Commit

Permalink
chore: remove duplicate tests
Browse files Browse the repository at this point in the history
Fixes the following flake8 issue:

	ihatemoney/tests/budget_test.py:880:5: F811 redefinition of unused 'test_reimbursement_bill' from line 796
	ihatemoney/tests/budget_test.py:930:5: F811 redefinition of unused 'test_transfer_bill' from line 846

PR #1290 introduced these tests twice.
  • Loading branch information
rriski committed Mar 24, 2024
1 parent 1381a47 commit 7694c69
Showing 1 changed file with 0 additions and 84 deletions.
84 changes: 0 additions & 84 deletions ihatemoney/tests/budget_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,90 +877,6 @@ def test_transfer_bill(self):
balance = self.get_project("random").balance
assert set(balance.values()), set([500 == -500])

def test_reimbursement_bill(self):
self.post_project("rent")

# add two participants
self.client.post("/rent/members/add", data={"name": "bob"})
self.client.post("/rent/members/add", data={"name": "alice"})

members_ids = [m.id for m in self.get_project("rent").members]
# create a bill to test reimbursement
self.client.post(
"/rent/add",
data={
"date": "2022-12-12",
"what": "december rent",
"payer": members_ids[0], # bob
"payed_for": members_ids, # bob and alice
"bill_type": "Expense",
"amount": "1000",
},
)
# check balance
balance = self.get_project("rent").balance
assert set(balance.values()), set([500 == -500])
# check paid
bob_paid = self.get_project("rent").full_balance[2][members_ids[0]]
alice_paid = self.get_project("rent").full_balance[2][members_ids[1]]
assert bob_paid == 1000
assert alice_paid == 0

# test reimbursement bill
self.client.post(
"/rent/add",
data={
"date": "2022-12-13",
"what": "reimbursement for rent",
"payer": members_ids[1], # alice
"payed_for": members_ids[0], # bob
"bill_type": "Reimbursement",
"amount": "500",
},
)

balance = self.get_project("rent").balance
assert set(balance.values()), set([0 == 0])
# check paid
bob_paid = self.get_project("rent").full_balance[2][members_ids[0]]
alice_paid = self.get_project("rent").full_balance[2][members_ids[1]]
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

0 comments on commit 7694c69

Please sign in to comment.