Background tasks open their own session through `AsyncSessionLocal`, which the
request-scoped `get_db` override never reached — so any test exercising one ran
against the real configured database, inserting rows and, through the imports'
wipe-and-reinsert of `device_inventory_links`, deleting real ones.
Point the factory at the test engine in `app.db.database` and in every route
module that imported it by name, and restore it when the fixture tears down.
ha-relevant: no