From 923a7c41c1c8a7da962a0858d0e658c974ec74b2 Mon Sep 17 00:00:00 2001 From: Glandos Date: Sat, 28 Jan 2023 16:55:16 +0100 Subject: [PATCH] black formatting, since last black changed --- ihatemoney/history.py | 2 +- ihatemoney/models.py | 2 +- ihatemoney/run.py | 1 - ihatemoney/tests/api_test.py | 1 - ihatemoney/tests/budget_test.py | 6 ------ ihatemoney/tests/common/ihatemoney_testcase.py | 1 - ihatemoney/tests/history_test.py | 1 - ihatemoney/tests/main_test.py | 3 +-- 8 files changed, 3 insertions(+), 14 deletions(-) diff --git a/ihatemoney/history.py b/ihatemoney/history.py index ad240c2c..c324c4f7 100644 --- a/ihatemoney/history.py +++ b/ihatemoney/history.py @@ -111,7 +111,7 @@ def get_history(project, human_readable_names=True): ): del changeset["converted_amount"] - for (prop, (val_before, val_after)) in changeset.items(): + for prop, (val_before, val_after) in changeset.items(): if human_readable_names: if prop == "payer_id": prop = "payer" diff --git a/ihatemoney/models.py b/ihatemoney/models.py index 10615d42..edd0543a 100644 --- a/ihatemoney/models.py +++ b/ihatemoney/models.py @@ -537,7 +537,7 @@ class Project(db.Model): ("Alice", 20, ("Amina", "Alice"), "Beer !"), ("Amina", 50, ("Amina", "Alice", "Georg"), "AMAP"), ) - for (payer, amount, owers, what) in operations: + for payer, amount, owers, what in operations: db.session.add( Bill( amount=amount, diff --git a/ihatemoney/run.py b/ihatemoney/run.py index 88f49463..eb704222 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -86,7 +86,6 @@ def load_configuration(app, configuration=None): def validate_configuration(app): - if app.config["SECRET_KEY"] == default_settings.SECRET_KEY: warnings.warn( "Running a server without changing the SECRET_KEY can lead to" diff --git a/ihatemoney/tests/api_test.py b/ihatemoney/tests/api_test.py index 69c6ab85..585c795d 100644 --- a/ihatemoney/tests/api_test.py +++ b/ihatemoney/tests/api_test.py @@ -101,7 +101,6 @@ class APITestCase(IhatemoneyTestCase): # create it with self.app.mail.record_messages() as outbox: - resp = self.api_create("raclette") self.assertTrue(201, resp.status_code) diff --git a/ihatemoney/tests/budget_test.py b/ihatemoney/tests/budget_test.py index fb434fbb..ee10319e 100644 --- a/ihatemoney/tests/budget_test.py +++ b/ihatemoney/tests/budget_test.py @@ -22,7 +22,6 @@ class BudgetTestCase(IhatemoneyTestCase): """ # sending a message to one person with self.app.mail.record_messages() as outbox: - # create a project self.login("raclette") @@ -316,7 +315,6 @@ class BudgetTestCase(IhatemoneyTestCase): self.assertEqual(len(models.Project.query.all()), 1) def test_project_deletion(self): - with self.client as c: c.post( "/create", @@ -1365,7 +1363,6 @@ class BudgetTestCase(IhatemoneyTestCase): self.assertEqual(member, None) def test_currency_switch(self): - # A project should be editable self.post_project("raclette") @@ -1492,7 +1489,6 @@ class BudgetTestCase(IhatemoneyTestCase): self.assertEqual(self.get_project("raclette").default_currency, "USD") def test_currency_switch_to_bill_currency(self): - # Default currency is 'XXX', but we should start from a project with a currency self.post_project("raclette", default_currency="USD") @@ -1526,7 +1522,6 @@ class BudgetTestCase(IhatemoneyTestCase): assert bill.converted_amount == bill.amount def test_currency_switch_to_no_currency(self): - # Default currency is 'XXX', but we should start from a project with a currency self.post_project("raclette", default_currency="USD") @@ -1598,7 +1593,6 @@ class BudgetTestCase(IhatemoneyTestCase): assert "No bills" in resp.data.decode("utf-8") def test_decimals_on_weighted_members_list(self): - self.post_project("raclette") # add three users with different weights diff --git a/ihatemoney/tests/common/ihatemoney_testcase.py b/ihatemoney/tests/common/ihatemoney_testcase.py index b88831cc..4b11d475 100644 --- a/ihatemoney/tests/common/ihatemoney_testcase.py +++ b/ihatemoney/tests/common/ihatemoney_testcase.py @@ -10,7 +10,6 @@ from ihatemoney.run import create_app, db class BaseTestCase(TestCase): - SECRET_KEY = "TEST SESSION" SQLALCHEMY_DATABASE_URI = os.environ.get( "TESTING_SQLALCHEMY_DATABASE_URI", "sqlite://" diff --git a/ihatemoney/tests/history_test.py b/ihatemoney/tests/history_test.py index 5319b125..754d5a55 100644 --- a/ihatemoney/tests/history_test.py +++ b/ihatemoney/tests/history_test.py @@ -473,7 +473,6 @@ class HistoryTestCase(IhatemoneyTestCase): ) def test_double_bill_double_person_edit_second(self): - # add two members self.client.post("/demo/members/add", data={"name": "User 1"}) self.client.post("/demo/members/add", data={"name": "User 2"}) diff --git a/ihatemoney/tests/main_test.py b/ihatemoney/tests/main_test.py index f0a11d66..b5e35c7a 100644 --- a/ihatemoney/tests/main_test.py +++ b/ihatemoney/tests/main_test.py @@ -153,7 +153,7 @@ class ModelsTestCase(IhatemoneyTestCase): }, ) project = models.Project.query.get_by_name(name="raclette") - for (weight, bill) in project.get_bill_weights().all(): + for weight, bill in project.get_bill_weights().all(): if bill.what == "red wine": pay_each_expected = 20 / 2 self.assertEqual(bill.amount / weight, pay_each_expected) @@ -165,7 +165,6 @@ class ModelsTestCase(IhatemoneyTestCase): self.assertEqual(bill.amount / weight, pay_each_expected) def test_bill_pay_each(self): - self.post_project("raclette") # add members