SImple way to mock (noun) dependencies

I need to test an Authentication Plug that needs to consume a function of a context module, Accounts.get_user/1.

The best way to mock this would be something like:

defmodule Auth do
  use ExUnit.Case, async: true
  use Plug.Test
  test "auth works" do
    defmodule DummyAccounts do
      def get_user(_id), do: %User{}

    conn = conn(:get, "/hello")
    conn =, DummyAccounts)
    # asserts here