If 2nd test case runs after 1st test case then it is getting failed as the database is having ReservationInfo Entry which got created in the 1st test case.
defmodule MyProj.TestABC do
use ExUnit.Case
alias MyProj.Models.ReservationInfo
alias MyProj.Repo
test "Create Coordinates" do
reservation_result = ReservationInfo.create(["00.00", "00.01"])
assert reservation_result == [{"00.00", :created}, {"00.01", :created}]
end
test "Shouldn't have above created coordinates as it's different test case" do
assert [] == ReservationInfo.get_all()
end
end
I would like to truncate all data before running new test case, Just like Django cleans data for every test case.