title: Ecto.Repo receives a struct that does not implement Access behaviour
body: <p>i have a problem with an Ecto Repo and a schema in one of my 
  <strong>tests</strong>. The schema is the following:</p>
  
  <pre><code>defmodule Elixirserver.Transactions.Bank do
    @behaviour Elixirserver.ContentDump
  
    use Ecto.Schema
    import Ecto.Changeset
    alias Elixirserver.Transactions.Account
  
    @attrs [:name, :code]
  
    schema "banks" do
      field(:name, :string)
      field(:code, :string)
      has_many(:account, Account)
      timestamps()
    end
  
    @doc false
    def changeset(bank, attrs \\ []) do
      bank
      |&gt; cast(attrs, @attrs)
      |&gt; validate_required(@attrs)
    end
  
    def to_json(bank) do
      %{
        id: bank.id,
        name: bank.name,
        code: bank.code,
        type: "BANK"
      }
    end
  end
  </code></pre>
  
  <p>When i try to execute a test i obtain the following:</p>
  
  <pre><code>(UndefinedFunctionError) function 
  Elixirserver.Transactions.Bank.fetch/2 is undefined 
  (Elixirserver.Transactions.Bank does not implement the Access behaviour)
  </code></pre>
  
  <p>The test is this:</p>
  
  <pre><code>def create(conn, %{"bank" =&gt; bank_params}) do
    with {:ok, %Bank{} = bank} &lt;- Transactions.create_bank(bank_params) do
      conn
      |&gt; put_status(:created)
      |&gt; put_resp_header("location", bank_path(conn, :show, bank))
      |&gt; render("show.json", id: bank["id"])
    end
  end
  </code></pre>
  
  <p>Now, apparently this is because the Access behaviour is not implemented. Do i have to provide it explicitly ?</p>
  
  <p>I am using ExMachina to generate fixtures, and i generated the resources with <code>mix phx.gen.json</code>.</p>