Extract formatters into their own module

We have lots of functions for converting various types of data into
strings to be displayed to the user somewhere.

This commit collects all these functions into their own module, rather
than having them cluttering up `app/__init__.py` or buried amongst
various other things that have ended up in `app/utils.py`.
This commit is contained in:
Chris Hill-Scott
2021-01-06 12:12:01 +00:00
parent 8595fcf01e
commit 7a95e1618e
17 changed files with 473 additions and 442 deletions

View File

@@ -10,9 +10,9 @@ from freezegun import freeze_time
from notifications_utils.template import Template
from app import format_datetime_relative
from app.formatters import email_safe, round_to_significant_figures
from app.utils import (
Spreadsheet,
email_safe,
generate_next_dict,
generate_notifications_csv,
generate_previous_dict,
@@ -23,7 +23,6 @@ from app.utils import (
is_less_than_days_ago,
merge_jsonlike,
printing_today_or_tomorrow,
round_to_significant_figures,
)
from tests.conftest import fake_uuid