diff --git a/ihatemoney/tests/budget_test.py b/ihatemoney/tests/budget_test.py index a4dcf9e0..06681f06 100644 --- a/ihatemoney/tests/budget_test.py +++ b/ihatemoney/tests/budget_test.py @@ -113,7 +113,7 @@ class BudgetTestCase(IhatemoneyTestCase): ), follow_redirects=True, ) - assert "Create a new project" in resp.data.decode("utf-8") + self.assertIn("Create a new project", resp.data.decode("utf-8")) # A token MUST have a point between payload and signature resp = self.client.get("/raclette/join/token.invalid", follow_redirects=True) @@ -133,12 +133,12 @@ class BudgetTestCase(IhatemoneyTestCase): self.client.get(invite_link) data = self.client.get("/tartiflette/").data.decode("utf-8") # First join is OK - assert 'href="/raclette/"' in data + self.assertIn('href="/raclette/"', data) # Second join shouldn't add a double link self.client.get(invite_link) data = self.client.get("/tartiflette/").data.decode("utf-8") - assert data.count('href="/raclette/"') == 1 + self.assertEqual(data.count('href="/raclette/"'), 1) def test_invite_code_invalidation(self): """Test that invitation link expire after code change""" @@ -150,7 +150,7 @@ class BudgetTestCase(IhatemoneyTestCase): self.client.post("/exit") response = self.client.get(link) # Link is valid - assert response.status_code == 302 + self.assertEqual(response.status_code, 302) # Change password to invalidate token # Other data are required, but useless for the test @@ -164,8 +164,8 @@ class BudgetTestCase(IhatemoneyTestCase): }, follow_redirects=True, ) - assert response.status_code == 200 - assert "alert-danger" not in response.data.decode("utf-8") + self.assertEqual(response.status_code, 200) + self.assertNotIn("alert-danger", response.data.decode("utf-8")) self.client.post("/exit") response = self.client.get(link, follow_redirects=True) @@ -942,13 +942,13 @@ class BudgetTestCase(IhatemoneyTestCase): resp = self.client.get("/dashboard") pattern = re.compile(r"