From 5d344e5c7965651232c4a20a3a3cc187eb79f18d Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 20 Jan 2021 11:26:14 -0600 Subject: [PATCH] Only need to test if unconfirmed users are successfully deleted It's no longer possible to have an active user account with User.is_confirmed == false --- test/pleroma/user_test.exs | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index a85e89a50..7e1e75404 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -1563,31 +1563,15 @@ defmodule Pleroma.UserTest do end end - describe "delete/1 when confirmation is pending" do - setup do - user = insert(:user, is_confirmed: false) - {:ok, user: user} - end - - test "deletes user from database when activation required", %{user: user} do - clear_config([:instance, :account_activation_required], true) - - {:ok, job} = User.delete(user) - {:ok, _} = ObanHelpers.perform(job) - - refute User.get_cached_by_id(user.id) - refute User.get_by_id(user.id) - end + test "delete/1 when confirmation is pending deletes the user" do + clear_config([:instance, :account_activation_required], true) + user = insert(:user, is_confirmed: false) - test "deactivates user when activation is not required", %{user: user} do - clear_config([:instance, :account_activation_required], false) - - {:ok, job} = User.delete(user) - {:ok, _} = ObanHelpers.perform(job) + {:ok, job} = User.delete(user) + {:ok, _} = ObanHelpers.perform(job) - assert %{deactivated: true} = User.get_cached_by_id(user.id) - assert %{deactivated: true} = User.get_by_id(user.id) - end + refute User.get_cached_by_id(user.id) + refute User.get_by_id(user.id) end test "delete/1 when approval is pending deletes the user" do -- 2.45.2