Use config to control inclusion of test emoji
This commit is contained in:
parent
6df93e61c4
commit
eb4dd50f53
|
@ -172,6 +172,8 @@
|
||||||
|
|
||||||
config :pleroma, Pleroma.Uploaders.Uploader, timeout: 1_000
|
config :pleroma, Pleroma.Uploaders.Uploader, timeout: 1_000
|
||||||
|
|
||||||
|
config :pleroma, Pleroma.Emoji.Loader, test_emoji: true
|
||||||
|
|
||||||
if File.exists?("./config/test.secret.exs") do
|
if File.exists?("./config/test.secret.exs") do
|
||||||
import_config "test.secret.exs"
|
import_config "test.secret.exs"
|
||||||
else
|
else
|
||||||
|
|
|
@ -15,8 +15,6 @@ defmodule Pleroma.Emoji.Loader do
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@mix_env Mix.env()
|
|
||||||
|
|
||||||
@type pattern :: Regex.t() | module() | String.t()
|
@type pattern :: Regex.t() | module() | String.t()
|
||||||
@type patterns :: pattern() | [pattern()]
|
@type patterns :: pattern() | [pattern()]
|
||||||
@type group_patterns :: keyword(patterns())
|
@type group_patterns :: keyword(patterns())
|
||||||
|
@ -79,7 +77,7 @@ def load do
|
||||||
|
|
||||||
# for testing emoji.txt entries we do not want exposed in normal operation
|
# for testing emoji.txt entries we do not want exposed in normal operation
|
||||||
test_emoji =
|
test_emoji =
|
||||||
if @mix_env == :test do
|
if Application.get_env(:pleroma, __MODULE__)[:test_emoji] do
|
||||||
load_from_file("test/config/emoji.txt", emoji_groups)
|
load_from_file("test/config/emoji.txt", emoji_groups)
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Reference in New Issue