# Pleroma: A lightweight social networking server
# Copyright © 2017-2023 Pleroma Authors
Reported by: #{reporter.nickname}
\nReported Account: #{account.nickname}
\nComment: Test comment\n
Statuses:\n
\nView Reports in AdminFE\n" end test "it works when the reporter is a remote user without email" do config = Pleroma.Config.get(:instance) to_user = insert(:user) reporter = insert(:user, email: nil, local: false) account = insert(:user) res = AdminEmail.report(to_user, reporter, account, [%{name: "Test", id: "12"}], "Test comment") assert res.to == [{to_user.name, to_user.email}] assert res.from == {config[:name], config[:notify_email]} end test "new unapproved registration email" do config = Pleroma.Config.get(:instance) to_user = insert(:user) account = insert(:user, registration_reason: "Plz let me in") res = AdminEmail.new_unapproved_registration(to_user, account) account_url = account.ap_id assert res.to == [{to_user.name, to_user.email}] assert res.from == {config[:name], config[:notify_email]} assert res.subject == "New account up for review on #{config[:name]} (@#{account.nickname})" assert res.html_body == """
New account for review: @#{account.nickname}
Plz let me inVisit AdminFE """ end end