Creates a custom test server to reduce boilerplate in test files when mocking
Homeflow api requests.
Most models will use the Agency model in some way, often to access the current
agency's id. Any usage of the Agency will require mocking the hestia/sites request, as well as potentially mocking the dbapi/sites request, which
in turn requires mocking the app authentication request via users api.
Adding each of these mocks to every test file is repetive and bloats the tests
with additional imports. createHFServer mocks the default requests required
by most models and allows passing in of model specific mocked requests,
reducing boilerplate code.
Creates a custom test server to reduce boilerplate in test files when mocking Homeflow api requests.
Most models will use the
Agencymodel in some way, often to access the current agency'sid. Any usage of theAgencywill require mocking thehestia/sitesrequest, as well as potentially mocking thedbapi/sitesrequest, which in turn requires mocking the app authentication request viausersapi.Adding each of these mocks to every test file is repetive and bloats the tests with additional imports.
createHFServermocks the default requests required by most models and allows passing in of model specific mocked requests, reducing boilerplate code.