From 0d8cee2938cc1537c195b796e4acc73b8ac2e238 Mon Sep 17 00:00:00 2001 From: WojtekMs <62173407+WojtekMs@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:04:56 +0100 Subject: [PATCH] Make money formatting test locale independent --- .../formatter/test_html_transactions_formatter.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/banker/formatter/test_html_transactions_formatter.py b/tests/banker/formatter/test_html_transactions_formatter.py index ca675c9..139e91b 100644 --- a/tests/banker/formatter/test_html_transactions_formatter.py +++ b/tests/banker/formatter/test_html_transactions_formatter.py @@ -1,5 +1,7 @@ import pytest +from moneyed import format_money +from banker.common.locale import get_numeric_locale from banker.formatter.html_transactions_formatter import HtmlTransactionsFormatter @@ -31,9 +33,8 @@ def test_given_empty_transactions_when_format_transactions_then_return_empty_tab def test_given_transactions_when_format_transactions_then_return_html_table_with_headers_and_rows( html_transactions_formatter_sut, transaction1, transaction2): - html_hard_space = "\xa0" - expected_transaction_1_value = f"-37,35{html_hard_space}zł" - expected_transaction_2_value = f"-200,00{html_hard_space}zł" + expected_transaction_1_value = format_money(transaction1.value, locale=get_numeric_locale()) + expected_transaction_2_value = format_money(transaction2.value, locale=get_numeric_locale()) expected_result = ('