Use a ModelList for lists of jobs

This follows the pattern of what we’ve done with services, users and
events.

It gives us a way of neatly instantiating a model for each item in the
list we get back from the API and reduces the complexity of the view
layer code.

Now is a good time to do this because we’re going to be making a bunch
of changes to the jobs pages, and those changes will be easier to code
and understand with a sensible model behind them.
This commit is contained in:
Chris Hill-Scott
2020-01-08 14:29:56 +00:00
parent 5e7ec3e30d
commit 25464a141b
13 changed files with 106 additions and 76 deletions

View File

@@ -1366,7 +1366,8 @@ def test_should_show_all_jobs_with_valid_statuses(
mock_get_service_templates_when_no_templates_exist,
mock_get_jobs,
mock_get_usage,
mock_get_inbound_sms_summary
mock_get_inbound_sms_summary,
mock_get_free_sms_fragment_limit,
):
logged_in_client.get(url_for('main.service_dashboard', service_id=SERVICE_ONE_ID))