1 defmodule Pleroma.Web.ChannelCase do
3 This module defines the test case to be used by
6 Such tests rely on `Phoenix.ChannelTest` and also
7 import other functionality to make it easier
8 to build common datastructures and query the data layer.
10 Finally, if the test case interacts with the database,
11 it cannot be async. For this reason, every test runs
12 inside a transaction which is reset at the beginning
13 of the test unless the test case is marked as async.
16 use ExUnit.CaseTemplate
20 # Import conveniences for testing with channels
21 use Phoenix.ChannelTest
23 # The default endpoint for testing
24 @endpoint Pleroma.Web.Endpoint
29 :ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
31 unless tags[:async] do
32 Ecto.Adapters.SQL.Sandbox.mode(Pleroma.Repo, {:shared, self()})