22 lines
740 B
Python
22 lines
740 B
Python
from decimal import Decimal
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
from app.main import app
|
|
from app.utils.formatters import format_money
|
|
|
|
|
|
def test_money_formatter_uses_russian_currency_display_without_mutating_decimal():
|
|
value = Decimal("3287651.331719")
|
|
assert format_money(value, "RUB") == "3 287 651,33 ₽"
|
|
assert value == Decimal("3287651.331719")
|
|
assert format_money(Decimal("804.036138")) == "804,04 ₽"
|
|
assert format_money(Decimal("804.036138"), "USD") == "804,04 USD"
|
|
|
|
|
|
def test_root_redirects_to_project_list():
|
|
with TestClient(app) as client:
|
|
response = client.get("/", follow_redirects=False)
|
|
assert response.status_code == 307
|
|
assert response.headers["location"] == "/projects/"
|