Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youegraillot committed Dec 13, 2021
1 parent ef92181 commit 7d3d669
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ihatemoney/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def switch_currency(self, new_currency):
db.session.add(self)
db.session.commit()

def import_bills(self, bills: list[dict]):
def import_bills(self, bills: list):
"""Import bills from a list of dictionaries"""
# Add members not already in the project
members_project = [str(m) for m in self.members]
Expand Down Expand Up @@ -621,14 +621,14 @@ def delete(self, project, id):
def __init__(
self,
amount: float,
date: object = None,
date: datetime = None,
external_link: str = "",
original_currency: str = "",
owers: list[Person] = [],
owers: list = [],
payer_id: int = None,
project_default_currency: str = "",
what: str = "",
) -> None:
):
super().__init__()
self.amount = amount
self.date = date
Expand Down
2 changes: 1 addition & 1 deletion ihatemoney/tests/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_bill_pay_each(self):
},
)

project = self.get_project_by_name(name="raclette")
project = models.Project.query.get_by_name(name="raclette")
zorglub = models.Person.query.get_by_name(name="zorglub", project=project)
zorglub_bills = models.Bill.query.options(
orm.subqueryload(models.Bill.owers)
Expand Down
6 changes: 3 additions & 3 deletions ihatemoney/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import json
import os

from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from flask import (
Blueprint,
Expand Down Expand Up @@ -454,7 +453,7 @@ def import_project():
elif data.mimetype == "text/csv":
try:
bills = csv2list_of_dicts(data)
except Exception as b:
except Exception:
raise ValueError(_("Unable to parse CSV"))
else:
raise ValueError("Unsupported file type")
Expand Down Expand Up @@ -484,7 +483,8 @@ def import_project():
if len(currencies - {CurrencyConverter.no_currency}) >= 2:
raise ValueError(
_(
"Cannot add bills in multiple currencies to a project without default currency"
"Cannot add bills in multiple currencies to a project without default "
"currency"
)
)
# Strip currency from bills (since it's the same for every bill)
Expand Down

0 comments on commit 7d3d669

Please sign in to comment.