diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-13 21:55:47 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-02-13 21:55:47 +0300 |
commit | 4f8c3462a8821ffcf83f8b65edf48e55eff7080c (patch) | |
tree | a532e6761adde4e23f2b7e980f76e4c6f5b08148 /test/repo_test.exs | |
parent | 9906c6fb6fb0e2ebb36fa91fae94828bcc02ef27 (diff) | |
download | pleroma-4f8c3462a8821ffcf83f8b65edf48e55eff7080c.tar.gz |
Tweaks to `clear_config` calls in tests in order to prevent side effects on config during test suite execution.
Diffstat (limited to 'test/repo_test.exs')
-rw-r--r-- | test/repo_test.exs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/test/repo_test.exs b/test/repo_test.exs index 5526b0327..2224a6b2b 100644 --- a/test/repo_test.exs +++ b/test/repo_test.exs @@ -67,6 +67,8 @@ defmodule Pleroma.RepoTest do :ok end + clear_config([:i_am_aware_this_may_cause_data_loss, :disable_migration_check]) + test "raises if it detects unapplied migrations" do assert_raise Pleroma.Repo.UnappliedMigrationsError, fn -> capture_log(&Repo.check_migrations_applied!/0) @@ -74,18 +76,8 @@ defmodule Pleroma.RepoTest do end test "doesn't do anything if disabled" do - disable_migration_check = - Pleroma.Config.get([:i_am_aware_this_may_cause_data_loss, :disable_migration_check]) - Pleroma.Config.put([:i_am_aware_this_may_cause_data_loss, :disable_migration_check], true) - on_exit(fn -> - Pleroma.Config.put( - [:i_am_aware_this_may_cause_data_loss, :disable_migration_check], - disable_migration_check - ) - end) - assert :ok == Repo.check_migrations_applied!() end end |