i have a test for a entity that has a enum column, example:
schema "cars" do
field :manufacturer, Ecto.enum, values [:bmw, :volks]
end
and inside my factory i have:
defmodule MyApp.Factories.CarsFactory do
@moduledoc false
defmacro __using__(_opts) do
quote do
alias MyApp.Cars.Car
def car_factory do
%Car{
manufacturer: Car |> Ecto.Enum.values(:manufacturer) |> Enum.random()
}
end
end
end
but when i run the tests i get key: has already been taken error on test fixtures
only on create/update