Phoenix/Elixir/Ecto seems to handle this really well. When you write a test in Phoenix, you can use `DataCase` which automatically creates sandboxed transactions [1] for each test. This makes writing integration tests a breeze.
[1] https://hexdocs.pm/ecto_sql/Ecto.Adapters.SQL.html#module-sq...