From eb4dd50f533380218bcde1a4107e2c0d38b4ec0d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sun, 21 Jan 2024 14:57:29 -0500 Subject: [PATCH] Use config to control inclusion of test emoji --- config/test.exs | 2 ++ lib/pleroma/emoji/loader.ex | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/test.exs b/config/test.exs index 40e93705d..9d752bdf8 100644 --- a/config/test.exs +++ b/config/test.exs @@ -172,6 +172,8 @@ config :pleroma, Pleroma.Application, config :pleroma, Pleroma.Uploaders.Uploader, timeout: 1_000 +config :pleroma, Pleroma.Emoji.Loader, test_emoji: true + if File.exists?("./config/test.secret.exs") do import_config "test.secret.exs" else diff --git a/lib/pleroma/emoji/loader.ex b/lib/pleroma/emoji/loader.ex index eb6f6816b..b6e544323 100644 --- a/lib/pleroma/emoji/loader.ex +++ b/lib/pleroma/emoji/loader.ex @@ -15,8 +15,6 @@ defmodule Pleroma.Emoji.Loader do require Logger - @mix_env Mix.env() - @type pattern :: Regex.t() | module() | String.t() @type patterns :: pattern() | [pattern()] @type group_patterns :: keyword(patterns()) @@ -79,7 +77,7 @@ defmodule Pleroma.Emoji.Loader do # for testing emoji.txt entries we do not want exposed in normal operation 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) else []