mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Simplify test for statistics page (no functional change)
This commit is contained in:
parent
15ab04e636
commit
76fe76f262
1 changed files with 9 additions and 34 deletions
|
@ -939,43 +939,18 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
response = self.client.get("/raclette/statistics")
|
response = self.client.get("/raclette/statistics")
|
||||||
first_cell = '<td class="d-md-none">'
|
regex = r"<td class=\"d-md-none\">{}</td>\s+<td>{}</td>\s+<td>{}</td>"
|
||||||
indent = "\n "
|
self.assertRegex(
|
||||||
self.assertIn(
|
response.data.decode("utf-8"), regex.format("alexis", "20.00", "31.67"),
|
||||||
first_cell
|
|
||||||
+ "alexis</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>20.00</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>31.67</td>\n",
|
|
||||||
response.data.decode("utf-8"),
|
|
||||||
)
|
)
|
||||||
self.assertIn(
|
self.assertRegex(
|
||||||
first_cell
|
response.data.decode("utf-8"), regex.format("fred", "20.00", "5.83"),
|
||||||
+ "fred</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>20.00</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>5.83</td>\n",
|
|
||||||
response.data.decode("utf-8"),
|
|
||||||
)
|
)
|
||||||
self.assertIn(
|
self.assertRegex(
|
||||||
first_cell
|
response.data.decode("utf-8"), regex.format("tata", "0.00", "2.50"),
|
||||||
+ "tata</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>0.00</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>2.50</td>\n",
|
|
||||||
response.data.decode("utf-8"),
|
|
||||||
)
|
)
|
||||||
self.assertIn(
|
self.assertRegex(
|
||||||
first_cell
|
response.data.decode("utf-8"), regex.format("toto", "0.00", "0.00"),
|
||||||
+ "toto</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>0.00</td>"
|
|
||||||
+ indent
|
|
||||||
+ "<td>0.00</td>\n",
|
|
||||||
response.data.decode("utf-8"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_settle_page(self):
|
def test_settle_page(self):
|
||||||
|
|
Loading…
Reference in a new issue