<%= if @ecto do %>defmodule <%= @module %>.RepoCase do use ExUnit.CaseTemplate # SEE https://hexdocs.pm/ecto/testing-with-ecto.html for more information using do quote do # alias <%= @module %>.Repo # import Ecto # import Ecto.Query # import <%= @module %>.RepoCase end end setup tags do :ok = Ecto.Adapters.SQL.Sandbox.checkout(<%= @module %>.Repo) unless tags[:async] do Ecto.Adapters.SQL.Sandbox.mode(<%= @module %>.Repo, {:shared, self()}) end :ok end end <% end %>