Tests: Use NullCache for async tests.
[akkoma] / test / support / data_case.ex
index 1f1d40863655d6bcd950547487ddc70b6471c49e..a3ce9e282c8f942bf8471e93e714e7c17ef771bd 100644 (file)
@@ -65,8 +65,13 @@ defmodule Pleroma.DataCase do
   setup tags do
     :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
 
-    unless tags[:async] do
+    if tags[:async] do
+      Mox.stub_with(Pleroma.CachexMock, Pleroma.NullCache)
+      Mox.set_mox_private()
+    else
       Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()})
+      Mox.stub_with(Pleroma.CachexMock, Pleroma.CachexProxy)
+      Mox.set_mox_global()
       clear_cachex()
     end