test.exs 1.43 KB
Newer Older
lain's avatar
lain committed
1
2
3
4
5
6
use Mix.Config

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :pleroma, Pleroma.Web.Endpoint,
  http: [port: 4001],
7
8
  url: [port: 4001],
  server: true
lain's avatar
lain committed
9

vaartis's avatar
vaartis committed
10
11
12
# Disable captha for tests
config :pleroma, Pleroma.Captcha,
  enabled: true,
vaartis's avatar
vaartis committed
13
14
  # A fake captcha service for tests
  method: Pleroma.Captcha.Mock
vaartis's avatar
vaartis committed
15

lain's avatar
lain committed
16
17
18
# Print only warnings and errors during test
config :logger, level: :warn

href's avatar
href committed
19
config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
lain's avatar
lain committed
20

21
22
config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Test

lain's avatar
lain committed
23
24
25
26
27
28
# Configure your database
config :pleroma, Pleroma.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "pleroma_test",
Roger Braun's avatar
Roger Braun committed
29
  hostname: System.get_env("DB_HOST") || "localhost",
lain's avatar
lain committed
30
  pool: Ecto.Adapters.SQL.Sandbox
lain's avatar
lain committed
31
32

# Reduce hash rounds for testing
Thog's avatar
Thog committed
33
config :pbkdf2_elixir, rounds: 1
34

lain's avatar
lain committed
35
36
config :pleroma, :websub, Pleroma.Web.WebsubMock
config :pleroma, :ostatus, Pleroma.Web.OStatusMock
37
config :tesla, adapter: Tesla.Mock
38

minibikini's avatar
minibikini committed
39
40
41
42
43
44
config :web_push_encryption, :vapid_details,
  subject: "mailto:administrator@example.com",
  public_key:
    "BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
  private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"

45
46
47
48
49
try do
  import_config "test.secret.exs"
rescue
  _ ->
    IO.puts(
feld's avatar
Speling    
feld committed
50
      "You may want to create test.secret.exs to declare custom database connection parameters."
51
52
    )
end