test.exs 3.17 KB
Newer Older
Thomas Citharel's avatar
Thomas Citharel committed
1
import Config
Thomas Citharel's avatar
Thomas Citharel committed
2

3
4
5
6
config :mobilizon, :instance,
  name: "Test instance",
  registrations_open: true

Thomas Citharel's avatar
Thomas Citharel committed
7
8
# We don't run a server during test. If one is required,
# you can enable the server option below.
rustra's avatar
rustra committed
9
config :mobilizon, Mobilizon.Web.Endpoint,
10
  http: [
11
    port: 80
12
13
  ],
  url: [
14
15
    host: "mobilizon.test",
    scheme: "http"
16
  ],
17
  debug_errors: true,
18
  secret_key_base: "some secret",
Thomas Citharel's avatar
Thomas Citharel committed
19
20
21
  server: false

# Print only warnings and errors during test
22
config :logger,
23
  backends: [:console],
24
25
26
  compile_time_purge_matching: [
    [level_lower_than: :debug]
  ],
27
  level: :info
Thomas Citharel's avatar
Thomas Citharel committed
28
29

# Configure your database
miffy's avatar
miffy committed
30
31
config :mobilizon, Mobilizon.Storage.Repo,
  types: Mobilizon.Storage.PostgresTypes,
32
  username: System.get_env("MOBILIZON_DATABASE_USERNAME") || "mobilizon_test",
rustra's avatar
rustra committed
33
  password: System.get_env("MOBILIZON_DATABASE_PASSWORD") || "mobilizon",
34
35
  database: System.get_env("MOBILIZON_DATABASE_DBNAME") || "mobilizon_test",
  hostname: System.get_env("MOBILIZON_DATABASE_HOST") || "localhost",
36
  port: System.get_env("MOBILIZON_DATABASE_PORT") || "5432",
miffy's avatar
miffy committed
37
  pool: Ecto.Adapters.SQL.Sandbox
Thomas Citharel's avatar
Thomas Citharel committed
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
config :mobilizon, :ldap,
  enabled: System.get_env("LDAP_ENABLED") == "true",
  host: System.get_env("LDAP_HOST") || "localhost",
  port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  ssl: System.get_env("LDAP_SSL") == "true",
  sslopts: [],
  tls: System.get_env("LDAP_TLS") == "true",
  tlsopts: [],
  base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  uid: System.get_env("LDAP_UID") || "cn",
  require_bind_for_search: !(System.get_env("LDAP_REQUIRE_BIND_FOR_SEARCH") == "false"),
  # The full CN to filter by `memberOf`, or `false` if disabled
  group: false,
  # Either the admin UID matching the field in `uid`,
  # Either a tuple with the fully qualified DN: {:full, uid=admin,dc=example.com,dc=local}
  bind_uid: System.get_env("LDAP_BIND_UID"),
  bind_password: System.get_env("LDAP_BIND_PASSWORD")

rustra's avatar
rustra committed
57
config :mobilizon, Mobilizon.Web.Email.Mailer, adapter: Bamboo.TestAdapter
Thomas Citharel's avatar
Thomas Citharel committed
58

rustra's avatar
rustra committed
59
config :mobilizon, Mobilizon.Web.Upload, filters: [], link_name: false
Thomas Citharel's avatar
Thomas Citharel committed
60

rustra's avatar
rustra committed
61
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, uploads: "test/uploads"
Thomas Citharel's avatar
Thomas Citharel committed
62

63
64
config :mobilizon, :exports, path: "test/uploads/exports"

65
66
config :tz_world, data_dir: "_build/test/lib/tz_world/priv"

Thomas Citharel's avatar
Thomas Citharel committed
67
68
69
config :tesla, Mobilizon.Service.HTTP.ActivityPub,
  adapter: Mobilizon.Service.HTTP.ActivityPub.Mock

Thomas Citharel's avatar
Thomas Citharel committed
70
71
72
config :tesla, Mobilizon.Service.HTTP.WebfingerClient,
  adapter: Mobilizon.Service.HTTP.WebfingerClient.Mock

setop's avatar
setop committed
73
74
config :tesla, Mobilizon.Service.HTTP.GeospatialClient,
  adapter: Mobilizon.Service.HTTP.GeospatialClient.Mock
Thomas Citharel's avatar
Thomas Citharel committed
75

Thomas Citharel's avatar
Thomas Citharel committed
76
77
78
config :tesla, Mobilizon.Service.HTTP.HostMetaClient,
  adapter: Mobilizon.Service.HTTP.HostMetaClient.Mock

79
config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Mock
80

Thomas Citharel's avatar
Thomas Citharel committed
81
config :mobilizon, Oban, queues: false, plugins: false
82
83
84

config :mobilizon, Mobilizon.Web.Auth.Guardian, secret_key: "some secret"

85
86
config :mobilizon, :activitypub, sign_object_fetches: false

Thomas Citharel's avatar
Thomas Citharel committed
87
config :mobilizon, Mobilizon.Web.Gettext, allowed_locales: ["fr", "en", "es", "ru"]
Thomas Citharel's avatar
Thomas Citharel committed
88

Thomas Citharel's avatar
Thomas Citharel committed
89
90
config :junit_formatter, report_dir: "."

91
92
93
if System.get_env("DOCKER", "false") == "false" && File.exists?("./config/test.secret.exs") do
  import_config "test.secret.exs"
end