From 590a10af332650a8a1eb61db7db7457dc63f229a Mon Sep 17 00:00:00 2001 From: Mary Kate Date: Thu, 24 Dec 2020 16:40:08 -0600 Subject: Adds tests for breaking tag and mention links after text is converted from markdown to html --- test/pleroma/formatter_test.exs | 78 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'test') diff --git a/test/pleroma/formatter_test.exs b/test/pleroma/formatter_test.exs index 5781a3f01..f47331bc3 100644 --- a/test/pleroma/formatter_test.exs +++ b/test/pleroma/formatter_test.exs @@ -284,6 +284,34 @@ defmodule Pleroma.FormatterTest do assert {^expected_text, ^expected_mentions, []} = Formatter.linkify(text) end + + test "correctly parses mentions in html" do + text = "

@lain hello

" + lain = insert(:user, %{nickname: "lain"}) + + {text, mentions, []} = Formatter.linkify(text) + + assert length(mentions) == 1 + + expected_text = + ~s(

@lain hello

) + + assert expected_text == text + end + + test "correctly parses mentions on the last line of html" do + text = "

Hello

@lain

" + lain = insert(:user, %{nickname: "lain"}) + + {text, mentions, []} = Formatter.linkify(text) + + assert length(mentions) == 1 + + expected_text = + ~s(

Hello

@lain

) + + assert expected_text == text + end end describe ".parse_tags" do @@ -299,6 +327,56 @@ defmodule Pleroma.FormatterTest do assert {_text, [], ^expected_tags} = Formatter.linkify(text) end + + test "parses tags in html" do + text = "

This is a #test

" + + expected_tags = [ + {"#test", "test"}, + ] + + assert {_text, [], ^expected_tags} = Formatter.linkify(text) + end + + test "parses mulitple tags in html" do + text = "

#tag1 #tag2 #tag3 #tag4

" + + expected_tags = [ + {"#tag1", "tag1"}, + {"#tag2", "tag2"}, + {"#tag3", "tag3"}, + {"#tag4", "tag4"}, + ] + + assert {_text, [], ^expected_tags} = Formatter.linkify(text) + end + + test "parses tags on the last line of html" do + text = "

This is a

#test

" + + expected_tags = [ + {"#test", "test"}, + ] + + assert {_text, [], ^expected_tags} = Formatter.linkify(text) + end + + test "parses mulitple tags on mulitple lines in html" do + text = "

testing...

#tag1 #tag2 #tag3 #tag4

paragraph

#tag5 #tag6 #tag7 #tag8

" + + expected_tags = [ + {"#tag1", "tag1"}, + {"#tag2", "tag2"}, + {"#tag3", "tag3"}, + {"#tag4", "tag4"}, + {"#tag5", "tag5"}, + {"#tag6", "tag6"}, + {"#tag7", "tag7"}, + {"#tag8", "tag8"}, + ] + + assert {_text, [], ^expected_tags} = Formatter.linkify(text) + end end test "it escapes HTML in plain text" do -- cgit v1.2.3 From 33f063204edb63344628bdfa72ff11f81ded62a9 Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 28 Aug 2021 23:18:12 -0600 Subject: Add unit test for Pleroma API app controller --- .../controllers/app_controller_test.exs | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 test/pleroma/web/pleroma_api/controllers/app_controller_test.exs (limited to 'test') diff --git a/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs new file mode 100644 index 000000000..5e24e18a8 --- /dev/null +++ b/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs @@ -0,0 +1,53 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.PleromaAPI.AppControllerTest do + use Pleroma.Web.ConnCase, async: true + + alias Pleroma.Web.OAuth.App + alias Pleroma.Web.Push + + import Pleroma.Factory + + test "apps", %{conn: conn} do + user = insert(:user) + app_attrs = build(:oauth_app) + + creation = + conn + |> put_req_header("content-type", "application/json") + |> assign(:user, user) + |> post("/api/v1/apps", %{ + client_name: app_attrs.client_name, + redirect_uris: app_attrs.redirect_uris + }) + + [app] = App.get_user_apps(user) + + expected = %{ + "name" => app.client_name, + "website" => app.website, + "client_id" => app.client_id, + "client_secret" => app.client_secret, + "id" => app.id |> to_string(), + "redirect_uri" => app.redirect_uris, + "vapid_key" => Push.vapid_config() |> Keyword.get(:public_key) + } + + assert expected == json_response_and_validate_schema(creation, 200) + + response = + conn + |> put_req_header("content-type", "application/json") + |> assign(:user, user) + |> assign(:token, insert(:oauth_token, user: user, scopes: ["read", "follow"])) + |> get("/api/v1/pleroma/apps") + |> json_response_and_validate_schema(200) + + [apps] = response + + assert length(response) == 1 + assert apps["client_id"] == app.client_id + end +end -- cgit v1.2.3 From 8ef1d8b566147922c93528b0b60d00fb9e63686b Mon Sep 17 00:00:00 2001 From: Sean King Date: Sun, 26 Dec 2021 11:02:51 -0700 Subject: Revert "Merge branch 'notice-routes' into 'develop'" --- .../web/o_status/o_status_controller_test.exs | 50 ---------------------- .../web/plugs/frontend_static_plug_test.exs | 2 - 2 files changed, 52 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/o_status/o_status_controller_test.exs b/test/pleroma/web/o_status/o_status_controller_test.exs index 41aef98b1..81d669837 100644 --- a/test/pleroma/web/o_status/o_status_controller_test.exs +++ b/test/pleroma/web/o_status/o_status_controller_test.exs @@ -343,54 +343,4 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do |> response(200) end end - - describe "notice compatibility routes" do - test "Soapbox FE", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/@#{user.nickname}/posts/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - - test "Mastodon", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/@#{user.nickname}/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - - test "Twitter", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/#{user.nickname}/status/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - end end diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index 4b3925ad2..52379b86a 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -86,8 +86,6 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do "objects", "activities", "notice", - "@:nickname", - ":nickname", "users", "tags", "mailer", -- cgit v1.2.3 From 2e4a1c56c36fcd4b9ef34bd3a771abfe21cc71d5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 27 Dec 2021 18:14:15 -0600 Subject: AppController: test creating with and without a user --- .../controllers/app_controller_test.exs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs index 76d81b942..bfbb7f32d 100644 --- a/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs @@ -35,6 +35,33 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do end test "creates an oauth app", %{conn: conn} do + app_attrs = build(:oauth_app) + + conn = + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/apps", %{ + client_name: app_attrs.client_name, + redirect_uris: app_attrs.redirect_uris + }) + + [app] = Repo.all(App) + + expected = %{ + "name" => app.client_name, + "website" => app.website, + "client_id" => app.client_id, + "client_secret" => app.client_secret, + "id" => app.id |> to_string(), + "redirect_uri" => app.redirect_uris, + "vapid_key" => Push.vapid_config() |> Keyword.get(:public_key) + } + + assert expected == json_response_and_validate_schema(conn, 200) + assert app.user_id == nil + end + + test "creates an oauth app with a user", %{conn: conn} do user = insert(:user) app_attrs = build(:oauth_app) @@ -60,5 +87,6 @@ defmodule Pleroma.Web.MastodonAPI.AppControllerTest do } assert expected == json_response_and_validate_schema(conn, 200) + assert app.user_id == user.id end end -- cgit v1.2.3 From cb2a072e6252b7c3f6473f7cfd1af5c0ec732d7b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 27 Dec 2021 18:29:03 -0600 Subject: Apps: add test for get_user_apps/1 --- test/pleroma/web/o_auth/app_test.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/o_auth/app_test.exs b/test/pleroma/web/o_auth/app_test.exs index fc2f0d940..a5223b0a5 100644 --- a/test/pleroma/web/o_auth/app_test.exs +++ b/test/pleroma/web/o_auth/app_test.exs @@ -41,4 +41,16 @@ defmodule Pleroma.Web.OAuth.AppTest do assert error.type == :unique end end + + test "get_user_apps/1" do + user = insert(:user) + + apps = [ + insert(:oauth_app, user_id: user.id), + insert(:oauth_app, user_id: user.id), + insert(:oauth_app, user_id: user.id) + ] + + assert App.get_user_apps(user) == apps + end end -- cgit v1.2.3 From 5c80d4087df2f6a8436af87ad109eb9e3bd4e3c1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 27 Dec 2021 18:52:34 -0600 Subject: PleromaAPI.AppView: add test --- .../pleroma/web/pleroma_api/views/app_view_test.exs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pleroma/web/pleroma_api/views/app_view_test.exs (limited to 'test') diff --git a/test/pleroma/web/pleroma_api/views/app_view_test.exs b/test/pleroma/web/pleroma_api/views/app_view_test.exs new file mode 100644 index 000000000..f0aee6987 --- /dev/null +++ b/test/pleroma/web/pleroma_api/views/app_view_test.exs @@ -0,0 +1,21 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.PleromaAPI.AppViewTest do + use Pleroma.DataCase, async: true + alias Pleroma.Web.PleromaAPI.AppView + import Pleroma.Factory + + test "index.json" do + apps = [ + insert(:oauth_app), + insert(:oauth_app), + insert(:oauth_app) + ] + + results = AppView.render("index.json", %{apps: apps}) + + assert [%{client_id: _, client_secret: _}, _, _] = results + end +end -- cgit v1.2.3 From f734579965b6f1a635e0622356e9cf6d4fff00bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 28 Dec 2021 16:11:17 +0100 Subject: MastoAPI: Add `GET /api/v1/accounts/lookup` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../controllers/account_controller_test.exs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index a92a58224..86349619e 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1776,4 +1776,28 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert [%{"id" => ^id2}] = result end + + test "account lookup", %{conn: conn} do + %{nickname: acct} = insert(:user, %{nickname: "nickname"}) + %{nickname: acct_two} = insert(:user, %{nickname: "nickname@notlocaldoma.in"}) + + result = + conn + |> get("/api/v1/accounts/lookup?acct=#{acct}") + |> json_response_and_validate_schema(200) + + assert %{"acct" => ^acct} = result + + result = + conn + |> get("/api/v1/accounts/lookup?acct=#{acct_two}") + |> json_response_and_validate_schema(200) + + assert %{"acct" => ^acct_two} = result + + _result = + conn + |> get("/api/v1/accounts/lookup?acct=unexisting_nickname") + |> json_response_and_validate_schema(404) + end end -- cgit v1.2.3 From 2ae867842b3d19df43ff42347a6590ba558d9282 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 31 Dec 2021 10:29:50 -0600 Subject: StreamerTest: tag erratic test --- test/pleroma/web/streamer_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/web/streamer_test.exs b/test/pleroma/web/streamer_test.exs index b788a9138..b2941a62c 100644 --- a/test/pleroma/web/streamer_test.exs +++ b/test/pleroma/web/streamer_test.exs @@ -772,6 +772,7 @@ defmodule Pleroma.Web.StreamerTest do refute_receive _ end + @tag :erratic test "it sends conversation update to the 'direct' stream when a message is deleted", %{ user: user, token: oauth_token -- cgit v1.2.3 From fd043b0ab38358eb3500249688b1861cc720073d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 10 Jan 2022 17:50:39 +0300 Subject: Escape unicode RTL overrides in rich media parser tests Elixir 1.13 does not allow them in raw form anymore, resulting in errors like this when running the test: == Compilation error in file test/pleroma/web/rich_media/parser_test.exs == ** (SyntaxError) test/pleroma/web/rich_media/parser_test.exs:136:45: invalid bidirectional formatting character in string: \u202C. If you want to use such character, use it in its escaped \u202C form instead --- test/pleroma/web/rich_media/parser_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/rich_media/parser_test.exs b/test/pleroma/web/rich_media/parser_test.exs index 2f363b012..2fe7f1b0b 100644 --- a/test/pleroma/web/rich_media/parser_test.exs +++ b/test/pleroma/web/rich_media/parser_test.exs @@ -133,13 +133,13 @@ defmodule Pleroma.Web.RichMedia.ParserTest do assert Parser.parse("http://example.com/oembed") == {:ok, %{ - "author_name" => "‮‭‬bees‬", + "author_name" => "\u202E\u202D\u202Cbees\u202C", "author_url" => "https://www.flickr.com/photos/bees/", "cache_age" => 3600, "flickr_type" => "photo", "height" => "768", "html" => - "\"Bacon", + "\"Bacon", "license" => "All Rights Reserved", "license_id" => 0, "provider_name" => "Flickr", -- cgit v1.2.3 From 0f90fd58052aa372aaad63d769cd724046c9f61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 10 Jan 2022 21:35:55 +0100 Subject: WIP account endorsements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../controllers/account_controller_test.exs | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index 374e2048a..828ebddd6 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1838,4 +1838,57 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/accounts/relationships?id=#{other_user.id}") |> json_response_and_validate_schema(200) end + + describe "account endorsements" do + setup do: oauth_access(["read:accounts", "write:accounts", "write:follows"]) + + setup do: clear_config([:instance, :max_endorsed_users], 1) + + test "pin account", %{user: user, conn: conn} do + %{id: id1} = insert(:user) + + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id1}/follow") + |> json_response_and_validate_schema(200) + + assert %{"id" => ^id1, "endorsed" => true} = + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id1}/pin") + |> json_response_and_validate_schema(200) + + assert [%{"id" => ^id1}] = + conn + |> put_req_header("content-type", "application/json") + |> get("/api/v1/endorsements") + |> json_response_and_validate_schema(200) + end + + test "max pinned accounts", %{user: user, conn: conn} do + %{id: id1} = insert(:user) + %{id: id2} = insert(:user) + + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id1}/follow") + |> json_response_and_validate_schema(200) + + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id2}/follow") + |> json_response_and_validate_schema(200) + + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id1}/pin") + |> json_response_and_validate_schema(200) + + assert %{"error" => "You have already pinned the maximum number of users"} = + conn + |> assign(:user, user) + |> post("/api/v1/accounts/#{id2}/pin") + |> json_response_and_validate_schema(400) + end + end end -- cgit v1.2.3 From eedf551eedd7acb854498303259598ad7aa72b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 12 Jan 2022 21:39:14 +0100 Subject: Add more tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/user_test.exs | 35 ++++++++++++++++++ test/pleroma/web/common_api_test.exs | 12 +++++++ .../controllers/account_controller_test.exs | 41 +++++++++++++--------- .../controllers/account_controller_test.exs | 25 +++++++++++++ 4 files changed, 97 insertions(+), 16 deletions(-) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 6cd93c34c..0345a9290 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -2498,4 +2498,39 @@ defmodule Pleroma.UserTest do %{object: %{data: %{"id" => object_id}}} = Activity.get_by_id_with_object(id) object_id end + + describe "account endorsements" do + test "it pins people" do + user = insert(:user) + pinned_user = insert(:user) + + {:ok, _pinned_user, _user} = User.follow(user, pinned_user) + + refute User.endorses?(user, pinned_user) + + {:ok, _user_relationship} = User.endorse(user, pinned_user) + + assert User.endorses?(user, pinned_user) + end + + test "it unpins users" do + user = insert(:user) + pinned_user = insert(:user) + + {:ok, _pinned_user, _user} = User.follow(user, pinned_user) + {:ok, _user_relationship} = User.endorse(user, pinned_user) + {:ok, _user_pin} = User.unendorse(user, pinned_user) + + refute User.endorses?(user, pinned_user) + end + + test "it doesn't pin users you do not follow" do + user = insert(:user) + pinned_user = insert(:user) + + assert {:error, _message} = User.endorse(user, pinned_user) + + refute User.endorses?(user, pinned_user) + end + end end diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index ad0b87543..4b186ccfc 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -1207,6 +1207,18 @@ defmodule Pleroma.Web.CommonAPITest do refute User.subscribed_to?(follower, followed) end + test "also unpins a user" do + [follower, followed] = insert_pair(:user) + {:ok, follower, followed, _} = CommonAPI.follow(follower, followed) + {:ok, _endorsement} = User.endorse(follower, followed) + + assert User.endorses?(follower, followed) + + {:ok, follower} = CommonAPI.unfollow(follower, followed) + + refute User.endorses?(follower, followed) + end + test "cancels a pending follow for a local user" do follower = insert(:user) followed = insert(:user, is_locked: true) diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index 828ebddd6..bba528d83 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1845,12 +1845,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do setup do: clear_config([:instance, :max_endorsed_users], 1) test "pin account", %{user: user, conn: conn} do - %{id: id1} = insert(:user) + %{id: id1} = other_user1 = insert(:user) - conn - |> put_req_header("content-type", "application/json") - |> post("/api/v1/accounts/#{id1}/follow") - |> json_response_and_validate_schema(200) + CommonAPI.follow(user, other_user1) assert %{"id" => ^id1, "endorsed" => true} = conn @@ -1865,19 +1862,31 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> json_response_and_validate_schema(200) end - test "max pinned accounts", %{user: user, conn: conn} do - %{id: id1} = insert(:user) - %{id: id2} = insert(:user) + test "unpin account", %{user: user, conn: conn} do + %{id: id1} = other_user1 = insert(:user) - conn - |> put_req_header("content-type", "application/json") - |> post("/api/v1/accounts/#{id1}/follow") - |> json_response_and_validate_schema(200) + CommonAPI.follow(user, other_user1) + User.endorse(user, other_user1) - conn - |> put_req_header("content-type", "application/json") - |> post("/api/v1/accounts/#{id2}/follow") - |> json_response_and_validate_schema(200) + assert %{"id" => ^id1, "endorsed" => false} = + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/accounts/#{id1}/unpin") + |> json_response_and_validate_schema(200) + + assert [] = + conn + |> put_req_header("content-type", "application/json") + |> get("/api/v1/endorsements") + |> json_response_and_validate_schema(200) + end + + test "max pinned accounts", %{user: user, conn: conn} do + %{id: id1} = other_user1 = insert(:user) + %{id: id2} = other_user2 = insert(:user) + + CommonAPI.follow(user, other_user1) + CommonAPI.follow(user, other_user2) conn |> put_req_header("content-type", "application/json") diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index ad271c31b..d9aa8ce55 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -279,4 +279,29 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do assert %{"error" => "Record not found"} = json_response_and_validate_schema(conn, 404) end end + + describe "account endorsements" do + test "returns a list of pinned accounts", %{conn: conn} do + %{id: id1} = user1 = insert(:user) + %{id: id2} = user2 = insert(:user) + %{id: id3} = user3 = insert(:user) + + CommonAPI.follow(user1, user2) + CommonAPI.follow(user1, user3) + + User.endorse(user1, user2) + User.endorse(user1, user3) + + [%{"id" => ^id2}, %{"id" => ^id3}] = + conn + |> get("/api/v1/pleroma/accounts/#{id1}/endorsements") + |> json_response_and_validate_schema(200) + end + + test "returns 404 error when specified user is not exist", %{conn: conn} do + conn = get(conn, "/api/v1/pleroma/accounts/test/endorsements") + + assert json_response_and_validate_schema(conn, 404) == %{"error" => "Record not found"} + end + end end -- cgit v1.2.3 From 31148c1857dae28377f9b864a9ebe143d99beb96 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 15 Jan 2022 12:31:36 -0600 Subject: FormatterTest: fix nesting in expected output --- test/pleroma/formatter_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/formatter_test.exs b/test/pleroma/formatter_test.exs index 5b8babc83..045edf4b1 100644 --- a/test/pleroma/formatter_test.exs +++ b/test/pleroma/formatter_test.exs @@ -294,7 +294,7 @@ defmodule Pleroma.FormatterTest do assert length(mentions) == 1 expected_text = - ~s(

Hello

@lain

) + ~s(

Hello

@lain

) assert expected_text == text end -- cgit v1.2.3 From 39c5ebb1f634b691d06d607d91cbfc6b0741d541 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 15 Jan 2022 12:55:12 -0600 Subject: mix format --- test/pleroma/formatter_test.exs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/pleroma/formatter_test.exs b/test/pleroma/formatter_test.exs index 045edf4b1..6663fdbc6 100644 --- a/test/pleroma/formatter_test.exs +++ b/test/pleroma/formatter_test.exs @@ -318,7 +318,7 @@ defmodule Pleroma.FormatterTest do text = "

This is a #test

" expected_tags = [ - {"#test", "test"}, + {"#test", "test"} ] assert {_text, [], ^expected_tags} = Formatter.linkify(text) @@ -331,7 +331,7 @@ defmodule Pleroma.FormatterTest do {"#tag1", "tag1"}, {"#tag2", "tag2"}, {"#tag3", "tag3"}, - {"#tag4", "tag4"}, + {"#tag4", "tag4"} ] assert {_text, [], ^expected_tags} = Formatter.linkify(text) @@ -341,14 +341,15 @@ defmodule Pleroma.FormatterTest do text = "

This is a

#test

" expected_tags = [ - {"#test", "test"}, + {"#test", "test"} ] assert {_text, [], ^expected_tags} = Formatter.linkify(text) end test "parses mulitple tags on mulitple lines in html" do - text = "

testing...

#tag1 #tag2 #tag3 #tag4

paragraph

#tag5 #tag6 #tag7 #tag8

" + text = + "

testing...

#tag1 #tag2 #tag3 #tag4

paragraph

#tag5 #tag6 #tag7 #tag8

" expected_tags = [ {"#tag1", "tag1"}, @@ -358,7 +359,7 @@ defmodule Pleroma.FormatterTest do {"#tag5", "tag5"}, {"#tag6", "tag6"}, {"#tag7", "tag7"}, - {"#tag8", "tag8"}, + {"#tag8", "tag8"} ] assert {_text, [], ^expected_tags} = Formatter.linkify(text) -- cgit v1.2.3 From 397f67fef8658000be26fd3b9bd86f5968fcaf52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 18 Jan 2022 18:02:01 +0100 Subject: Format code, expose instance configuration related to birth dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/web/mastodon_api/views/account_view_test.exs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index c23ffb966..da8761355 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -79,6 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: ["https://shitposter.zone/users/shp"], background_image: "https://example.com/images/asuka_hospital.png", + birth_date: nil, favicon: nil, is_confirmed: true, tags: [], @@ -181,6 +182,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: [], background_image: nil, + birth_date: nil, favicon: nil, is_confirmed: true, tags: [], -- cgit v1.2.3 From dfb28085356aea63c2b0c755d7861946315c3931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 18 Jan 2022 19:29:21 +0100 Subject: Birth dates: Add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/user_test.exs | 48 +++++++++++++++++++ .../controllers/account_controller_test.exs | 54 ++++++++++++++++++++++ .../web/mastodon_api/update_credentials_test.exs | 20 ++++++++ .../controllers/account_controller_test.exs | 53 +++++++++++++++++++++ 4 files changed, 175 insertions(+) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 0345a9290..263c2b274 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -755,6 +755,54 @@ defmodule Pleroma.UserTest do end end + describe "user registration, with :birth_date_required and :birth_date_min_age" do + @full_user_data %{ + bio: "A guy", + name: "my name", + nickname: "nick", + password: "test", + password_confirmation: "test", + email: "email@example.com" + } + + setup do + clear_config([:instance, :birth_date_required], true) + clear_config([:instance, :birth_date_min_age], 18 * 365) + end + + test "it passes when correct birth date is provided" do + today = Date.utc_today() + birth_date = Date.add(today, -19 * 365) + + params = + @full_user_data + |> Map.put(:birth_date, birth_date) + + changeset = User.register_changeset(%User{}, params) + + assert changeset.valid? + end + + test "it fails when birth date is not provided" do + changeset = User.register_changeset(%User{}, @full_user_data) + + refute changeset.valid? + end + + test "it fails when provided invalid birth date" do + today = Date.utc_today() + birth_date = Date.add(today, -17 * 365) + + params = + @full_user_data + |> Map.put(:birth_date, birth_date) + + changeset = User.register_changeset(%User{}, params) + + refute changeset.valid? + end + end + describe "get_or_fetch/1" do test "gets an existing user by nickname" do user = insert(:user) diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index bba528d83..d8ebd98cc 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1586,6 +1586,60 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do end end + describe "create account with required birth date" do + setup %{conn: conn} do + clear_config([:instance, :birth_date_required], true) + clear_config([:instance, :birth_date_min_age], 18 * 365) + + app_token = insert(:oauth_token, user: nil) + + conn = + conn + |> put_req_header("authorization", "Bearer " <> app_token.token) + |> put_req_header("content-type", "multipart/form-data") + + [conn: conn] + end + + test "creates an account if provided valid birth date", %{conn: conn} do + birth_date = + Date.utc_today() + |> Date.add(-19 * 365) + |> Date.to_string() + + params = %{ + username: "mkljczk", + email: "mkljczk@example.org", + password: "dupa.8", + agreement: true, + birth_date: birth_date + } + + res = + conn + |> post("/api/v1/accounts", params) + + assert json_response_and_validate_schema(res, 200) + end + + test "returns an error if missing birth date", %{conn: conn} do + params = %{ + username: "mkljczk", + email: "mkljczk@example.org", + password: "dupa.8", + agreement: true + } + + res = + conn + |> post("/api/v1/accounts", params) + + assert json_response_and_validate_schema(res, 400) == %{ + "error" => "{\"birth_date\":[\"can't be blank\"]}" + } + end + end + describe "GET /api/v1/accounts/:id/lists - account_lists" do test "returns lists to which the account belongs" do %{user: user, conn: conn} = oauth_access(["read:lists"]) diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index 1d2027899..e89f597a9 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -370,6 +370,26 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do ] end + test "updates birth date", %{conn: conn, user: user} do + res = + patch(conn, "/api/v1/accounts/update_credentials", %{ + "birth_date" => "2001-02-12" + }) + + assert user_data = json_response_and_validate_schema(res, 200) + assert user_data["pleroma"]["birth_date"] == "2001-02-12" + end + + test "updates the user's hide_birth_date status", %{conn: conn} do + res = + patch(conn, "/api/v1/accounts/update_credentials", %{ + "hide_birth_date" => true + }) + + assert user_data = json_response_and_validate_schema(res, 200) + assert user_data["pleroma"]["hide_birth_date"] == true + end + test "emojis in fields labels", %{conn: conn} do fields = [ %{"name" => ":firefox:", "value" => "is best 2hu"}, diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index d9aa8ce55..5b74bb0b2 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -304,4 +304,57 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do assert json_response_and_validate_schema(conn, 404) == %{"error" => "Record not found"} end end + + describe "birthday reminders" do + test "returns a list of friends having birthday on specified day" do + %{user: user, conn: conn} = oauth_access(["read:accounts"]) + + %{id: id1} = + user1 = + insert(:user, %{ + birth_date: "2001-02-12" + }) + + user2 = + insert(:user, %{ + birth_date: "2001-02-14" + }) + + user3 = insert(:user) + + CommonAPI.follow(user, user1) + CommonAPI.follow(user, user2) + CommonAPI.follow(user, user3) + + [%{"id" => ^id1}] = + conn + |> get("/api/v1/pleroma/birthday_reminders?day=12&month=2") + |> json_response_and_validate_schema(:ok) + end + + test "the list doesn't list friends with hidden birth date" do + %{user: user, conn: conn} = oauth_access(["read:accounts"]) + + user1 = + insert(:user, %{ + birth_date: "2001-02-12", + hide_birth_date: true + }) + + %{id: id2} = + user2 = + insert(:user, %{ + birth_date: "2001-02-12", + hide_birth_date: false + }) + + CommonAPI.follow(user, user1) + CommonAPI.follow(user, user2) + + [%{"id" => ^id2}] = + conn + |> get("/api/v1/pleroma/birthday_reminders?day=12&month=2") + |> json_response_and_validate_schema(:ok) + end + end end -- cgit v1.2.3 From a02cfd7f5223da396538e264df580e7f33bee690 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 19 Jan 2022 19:40:50 +0300 Subject: Add ForceMentionsInContentPolicy Even though latest PleromaFE supports displaying these properly, mobile apps still exist, so I think we should offer a workaround to those who want it. --- test/fixtures/soapbox_no_mentions_in_content.json | 79 ++++++++++++++++++++++ .../mrf/force_mentions_in_content_test.exs | 34 ++++++++++ 2 files changed, 113 insertions(+) create mode 100644 test/fixtures/soapbox_no_mentions_in_content.json create mode 100644 test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs (limited to 'test') diff --git a/test/fixtures/soapbox_no_mentions_in_content.json b/test/fixtures/soapbox_no_mentions_in_content.json new file mode 100644 index 000000000..03b4b8ee4 --- /dev/null +++ b/test/fixtures/soapbox_no_mentions_in_content.json @@ -0,0 +1,79 @@ +{ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://gleasonator.com/schemas/litepub-0.1.jsonld", + { + "@language": "und" + } + ], + "actor": "https://gleasonator.com/users/alex", + "attachment": [ + { + "blurhash": "b15#-6_3~l%eDkNraAM#HYMf", + "height": 2147, + "mediaType": "image/png", + "name": "", + "type": "Document", + "url": "https://media.gleasonator.com/2df1c9cc26c35028db65848143971da0c5a6e04dbd423b194bb018b6c601db9b.png", + "width": 966 + }, + { + "blurhash": "b168EX~q~W-;DiM{VtIUD%Io", + "height": 2147, + "mediaType": "image/png", + "name": "", + "type": "Document", + "url": "https://media.gleasonator.com/22b42b4cddc1aecc7e2d3dc20bcdd66d5c4e44c2bef119de948e95a587e36b66.png", + "width": 966 + } + ], + "attributedTo": "https://gleasonator.com/users/alex", + "cc": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "content": "

Haha yeah, you can control who you reply to.

", + "context": "https://gleasonator.com/contexts/ba6c8bd9-ac4d-479e-9bd9-5bf570068ae7", + "conversation": "https://gleasonator.com/contexts/ba6c8bd9-ac4d-479e-9bd9-5bf570068ae7", + "id": "https://gleasonator.com/objects/02af65fe-04f8-46bc-9b1e-31dfe76eaffd", + "inReplyTo": "https://shitposter.club/objects/c686d811-4368-48e1-ba11-82c129f93165", + "published": "2022-01-19T03:37:35.976545Z", + "sensitive": false, + "source": "Haha yeah, you can control who you reply to.", + "summary": "", + "tag": [ + { + "href": "https://lain.com/users/lain", + "name": "@lain@lain.com", + "type": "Mention" + }, + { + "href": "https://shitposter.club/users/coolboymew", + "name": "@coolboymew@shitposter.club", + "type": "Mention" + }, + { + "href": "https://shitposter.club/users/dielan", + "name": "@dielan@shitposter.club", + "type": "Mention" + }, + { + "href": "https://tuusin.misono-ya.info/users/hakui", + "name": "@hakui@tuusin.misono-ya.info", + "type": "Mention" + }, + { + "href": "https://xyzzy.link/users/fence", + "name": "@fence@xyzzy.link", + "type": "Mention" + } + ], + "to": [ + "https://shitposter.club/users/dielan", + "https://gleasonator.com/users/alex/followers", + "https://shitposter.club/users/coolboymew", + "https://xyzzy.link/users/fence", + "https://tuusin.misono-ya.info/users/hakui", + "https://lain.com/users/lain" + ], + "type": "Note" +} diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs new file mode 100644 index 000000000..090bdc35e --- /dev/null +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -0,0 +1,34 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do + alias Pleroma.Web.ActivityPub.MRF.ForceMentionsInContent + import Pleroma.Factory + use Pleroma.DataCase + + test "adds mentions to post content" do + users = %{ + "lain@lain.com" => "https://lain.com/users/lain", + "coolboymew@shitposter.club" => "https://shitposter.club/users/coolboymew", + "dielan@shitposter.club" => "https://shitposter.club/users/dielan", + "hakui@tuusin.misono-ya.info" => "https://tuusin.misono-ya.info/users/hakui", + "fence@xyzzy.link" => "https://xyzzy.link/users/fence" + } + + Enum.each(users, fn {nickname, ap_id} -> + insert(:user, ap_id: ap_id, nickname: nickname, local: false) + end) + + object = File.read!("test/fixtures/soapbox_no_mentions_in_content.json") |> Jason.decode!() + + activity = %{ + "type" => "Create", + "actor" => "https://gleasonator.com/users/alex", + "object" => object + } + + {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) + Enum.each(users, fn {nickname, _} -> assert filtered =~ nickname end) + end +end -- cgit v1.2.3 From 88c21b928286782e174451fb6b039a34548ab75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 20 Jan 2022 11:59:15 +0100 Subject: Support private pinned posts from Mastodon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../mastodon/collections/external_featured.json | 14 ++++ .../pleroma/web/activity_pub/activity_pub_test.exs | 77 ++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 test/fixtures/mastodon/collections/external_featured.json (limited to 'test') diff --git a/test/fixtures/mastodon/collections/external_featured.json b/test/fixtures/mastodon/collections/external_featured.json new file mode 100644 index 000000000..be5302cf8 --- /dev/null +++ b/test/fixtures/mastodon/collections/external_featured.json @@ -0,0 +1,14 @@ +{ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://{{domain}}/schemas/litepub-0.1.jsonld", + { + "@language": "und" + } + ], + "id": "https://{{domain}}/users/{{nickname}}/collections/featured", + "orderedItems": [ + "https://{{domain}}/objects/{{object_id}}" + ], + "type": "OrderedCollection" +} diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index 574ef0d71..3d152b4d0 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -312,6 +312,83 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert %{data: %{"id" => ^object_url}} = Object.get_by_ap_id(object_url) end + + test "fetches user featured collection without embedded object" do + ap_id = "https://example.com/users/lain" + + featured_url = "https://example.com/users/lain/collections/featured" + + user_data = + "test/fixtures/users_mock/user.json" + |> File.read!() + |> String.replace("{{nickname}}", "lain") + |> Jason.decode!() + |> Map.put("featured", featured_url) + |> Jason.encode!() + + object_id = Ecto.UUID.generate() + + featured_data = + "test/fixtures/mastodon/collections/external_featured.json" + |> File.read!() + |> String.replace("{{domain}}", "example.com") + |> String.replace("{{nickname}}", "lain") + |> String.replace("{{object_id}}", object_id) + + object_url = "https://example.com/objects/#{object_id}" + + object_data = + "test/fixtures/statuses/note.json" + |> File.read!() + |> String.replace("{{object_id}}", object_id) + |> String.replace("{{nickname}}", "lain") + + Tesla.Mock.mock(fn + %{ + method: :get, + url: ^ap_id + } -> + %Tesla.Env{ + status: 200, + body: user_data, + headers: [{"content-type", "application/activity+json"}] + } + + %{ + method: :get, + url: ^featured_url + } -> + %Tesla.Env{ + status: 200, + body: featured_data, + headers: [{"content-type", "application/activity+json"}] + } + end) + + Tesla.Mock.mock_global(fn + %{ + method: :get, + url: ^object_url + } -> + %Tesla.Env{ + status: 200, + body: object_data, + headers: [{"content-type", "application/activity+json"}] + } + end) + + {:ok, user} = ActivityPub.make_user_from_ap_id(ap_id) + Process.sleep(50) + + assert user.featured_address == featured_url + assert Map.has_key?(user.pinned_objects, object_url) + + in_db = Pleroma.User.get_by_ap_id(ap_id) + assert in_db.featured_address == featured_url + assert Map.has_key?(user.pinned_objects, object_url) + + assert %{data: %{"id" => ^object_url}} = Object.get_by_ap_id(object_url) + end end test "it fetches the appropriate tag-restricted posts" do -- cgit v1.2.3 From 00523bdf5e4c61ffb1fdd66a3345a26848a20ca9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 20 Jan 2022 16:52:43 -0600 Subject: Test pinned private statuses in AccountController --- .../controllers/account_controller_test.exs | 40 +++++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index bba528d83..9b07cd5c2 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -5,7 +5,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do use Pleroma.Web.ConnCase + alias Pleroma.Object alias Pleroma.Repo + alias Pleroma.Tests.ObanHelpers alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.InternalFetchActor @@ -404,15 +406,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert id_two == to_string(activity.id) end - test "unimplemented pinned statuses feature", %{conn: conn} do - note = insert(:note_activity) - user = User.get_cached_by_ap_id(note.data["actor"]) - - conn = get(conn, "/api/v1/accounts/#{user.id}/statuses?pinned=true") - - assert json_response_and_validate_schema(conn, 200) == [] - end - test "gets an users media, excludes reblogs", %{conn: conn} do note = insert(:note_activity) user = User.get_cached_by_ap_id(note.data["actor"]) @@ -1038,6 +1031,35 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do end end + test "view pinned private statuses" do + user = insert(:user) + reader = insert(:user) + + # Create a private status and pin it + {:ok, %{id: activity_id} = activity} = + CommonAPI.post(user, %{status: "psst", visibility: "private"}) + + %{data: %{"id" => object_ap_id}} = Object.normalize(activity) + {:ok, _} = User.add_pinned_object_id(user, object_ap_id) + + %{conn: conn} = oauth_access(["read:statuses"], user: reader) + + # A non-follower can't see the pinned status + assert [] == + conn + |> get("/api/v1/accounts/#{user.id}/statuses?pinned=true") + |> json_response_and_validate_schema(200) + + # Follow the user, then the pinned status can be seen + CommonAPI.follow(reader, user) + ObanHelpers.perform_all() + + assert [%{"id" => ^activity_id, "pinned" => true}] = + conn + |> get("/api/v1/accounts/#{user.id}/statuses?pinned=true") + |> json_response_and_validate_schema(200) + end + test "blocking / unblocking a user" do %{conn: conn} = oauth_access(["follow"]) other_user = insert(:user) -- cgit v1.2.3 From f5d4ef50b4d86c33af924c44cfcb2d72202476d9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 22 Jan 2022 12:13:09 -0600 Subject: FilterTest: tag erratic test --- test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 98ab9e717..4f71b40d1 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -49,6 +49,7 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do assert filter.hide == true end + @tag :erratic test "a filter with expires_in", %{conn: conn, user: user} do in_seconds = 600 -- cgit v1.2.3 From 7a015b1fe2f177bcc4ea5941c454936d3792e935 Mon Sep 17 00:00:00 2001 From: NEETzsche Date: Sat, 22 Jan 2022 12:07:54 -0700 Subject: Make test less erratic by adding five second tolerance --- .../web/mastodon_api/controllers/filter_controller_test.exs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 4f71b40d1..5ed1f34b7 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -49,7 +49,6 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do assert filter.hide == true end - @tag :erratic test "a filter with expires_in", %{conn: conn, user: user} do in_seconds = 600 @@ -65,12 +64,13 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do assert response["irreversible"] == false - expires_at = + expected_expiration = NaiveDateTime.utc_now() |> NaiveDateTime.add(in_seconds) - |> Pleroma.Web.CommonAPI.Utils.to_masto_date() - assert response["expires_at"] == expires_at + {:ok, actual_expiration} = NaiveDateTime.from_iso8601(response["expires_at"]) + + assert abs(NaiveDateTime.diff(expected_expiration, actual_expiration)) <= 5 filter = Filter.get(response["id"], user) -- cgit v1.2.3 From 66e8c6f90fa0ca9ab01cc58c865344694548e4d6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 22 Jan 2022 13:21:55 -0600 Subject: Birthdays: birth_date --> birthday --- test/pleroma/user_test.exs | 14 +++++++------- .../mastodon_api/controllers/account_controller_test.exs | 10 +++++----- test/pleroma/web/mastodon_api/update_credentials_test.exs | 12 ++++++------ test/pleroma/web/mastodon_api/views/account_view_test.exs | 4 ++-- .../pleroma_api/controllers/account_controller_test.exs | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 263c2b274..9a902e8b1 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -755,7 +755,7 @@ defmodule Pleroma.UserTest do end end - describe "user registration, with :birth_date_required and :birth_date_min_age" do + describe "user registration, with :birthday_required and :birthday_min_age" do @full_user_data %{ bio: "A guy", name: "my name", @@ -766,17 +766,17 @@ defmodule Pleroma.UserTest do } setup do - clear_config([:instance, :birth_date_required], true) - clear_config([:instance, :birth_date_min_age], 18 * 365) + clear_config([:instance, :birthday_required], true) + clear_config([:instance, :birthday_min_age], 18 * 365) end test "it passes when correct birth date is provided" do today = Date.utc_today() - birth_date = Date.add(today, -19 * 365) + birthday = Date.add(today, -19 * 365) params = @full_user_data - |> Map.put(:birth_date, birth_date) + |> Map.put(:birthday, birthday) changeset = User.register_changeset(%User{}, params) @@ -791,11 +791,11 @@ defmodule Pleroma.UserTest do test "it fails when provided invalid birth date" do today = Date.utc_today() - birth_date = Date.add(today, -17 * 365) + birthday = Date.add(today, -17 * 365) params = @full_user_data - |> Map.put(:birth_date, birth_date) + |> Map.put(:birthday, birthday) changeset = User.register_changeset(%User{}, params) diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index d8ebd98cc..19d706958 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1588,8 +1588,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do describe "create account with required birth date" do setup %{conn: conn} do - clear_config([:instance, :birth_date_required], true) - clear_config([:instance, :birth_date_min_age], 18 * 365) + clear_config([:instance, :birthday_required], true) + clear_config([:instance, :birthday_min_age], 18 * 365) app_token = insert(:oauth_token, user: nil) @@ -1602,7 +1602,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do end test "creates an account if provided valid birth date", %{conn: conn} do - birth_date = + birthday = Date.utc_today() |> Date.add(-19 * 365) |> Date.to_string() @@ -1612,7 +1612,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do email: "mkljczk@example.org", password: "dupa.8", agreement: true, - birth_date: birth_date + birthday: birthday } res = @@ -1635,7 +1635,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> post("/api/v1/accounts", params) assert json_response_and_validate_schema(res, 400) == %{ - "error" => "{\"birth_date\":[\"can't be blank\"]}" + "error" => "{\"birthday\":[\"can't be blank\"]}" } end end diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index e89f597a9..5507a77b0 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -370,24 +370,24 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do ] end - test "updates birth date", %{conn: conn, user: user} do + test "updates birth date", %{conn: conn} do res = patch(conn, "/api/v1/accounts/update_credentials", %{ - "birth_date" => "2001-02-12" + "birthday" => "2001-02-12" }) assert user_data = json_response_and_validate_schema(res, 200) - assert user_data["pleroma"]["birth_date"] == "2001-02-12" + assert user_data["pleroma"]["birthday"] == "2001-02-12" end - test "updates the user's hide_birth_date status", %{conn: conn} do + test "updates the user's hide_birthday status", %{conn: conn} do res = patch(conn, "/api/v1/accounts/update_credentials", %{ - "hide_birth_date" => true + "hide_birthday" => true }) assert user_data = json_response_and_validate_schema(res, 200) - assert user_data["pleroma"]["hide_birth_date"] == true + assert user_data["pleroma"]["hide_birthday"] == true end test "emojis in fields labels", %{conn: conn} do diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index da8761355..329813994 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -79,7 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: ["https://shitposter.zone/users/shp"], background_image: "https://example.com/images/asuka_hospital.png", - birth_date: nil, + birthday: nil, favicon: nil, is_confirmed: true, tags: [], @@ -182,7 +182,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: [], background_image: nil, - birth_date: nil, + birthday: nil, favicon: nil, is_confirmed: true, tags: [], diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index 5b74bb0b2..8f3e565ee 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -312,12 +312,12 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do %{id: id1} = user1 = insert(:user, %{ - birth_date: "2001-02-12" + birthday: "2001-02-12" }) user2 = insert(:user, %{ - birth_date: "2001-02-14" + birthday: "2001-02-14" }) user3 = insert(:user) @@ -337,15 +337,15 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do user1 = insert(:user, %{ - birth_date: "2001-02-12", - hide_birth_date: true + birthday: "2001-02-12", + hide_birthday: true }) %{id: id2} = user2 = insert(:user, %{ - birth_date: "2001-02-12", - hide_birth_date: false + birthday: "2001-02-12", + hide_birthday: false }) CommonAPI.follow(user, user1) -- cgit v1.2.3 From 0266bc3c96c30cfee929c55babdca679ca17a479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 23 Jan 2022 08:42:18 +0100 Subject: Birthdays: hide_birthday -> show_birthday MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/web/mastodon_api/update_credentials_test.exs | 6 +++--- .../pleroma_api/controllers/account_controller_test.exs | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index 5507a77b0..9073cd771 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -380,14 +380,14 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do assert user_data["pleroma"]["birthday"] == "2001-02-12" end - test "updates the user's hide_birthday status", %{conn: conn} do + test "updates the user's show_birthday status", %{conn: conn} do res = patch(conn, "/api/v1/accounts/update_credentials", %{ - "hide_birthday" => true + "show_birthday" => true }) assert user_data = json_response_and_validate_schema(res, 200) - assert user_data["pleroma"]["hide_birthday"] == true + assert user_data["pleroma"]["source"]["show_birthday"] == true end test "emojis in fields labels", %{conn: conn} do diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index 8f3e565ee..15682e40a 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -312,12 +312,14 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do %{id: id1} = user1 = insert(:user, %{ - birthday: "2001-02-12" + birthday: "2001-02-12", + show_birthday: true }) user2 = insert(:user, %{ - birthday: "2001-02-14" + birthday: "2001-02-14", + show_birthday: true }) user3 = insert(:user) @@ -328,7 +330,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do [%{"id" => ^id1}] = conn - |> get("/api/v1/pleroma/birthday_reminders?day=12&month=2") + |> get("/api/v1/pleroma/birthdays?day=12&month=2") |> json_response_and_validate_schema(:ok) end @@ -338,14 +340,14 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do user1 = insert(:user, %{ birthday: "2001-02-12", - hide_birthday: true + show_birthday: false }) %{id: id2} = user2 = insert(:user, %{ birthday: "2001-02-12", - hide_birthday: false + show_birthday: true }) CommonAPI.follow(user, user1) @@ -353,7 +355,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do [%{"id" => ^id2}] = conn - |> get("/api/v1/pleroma/birthday_reminders?day=12&month=2") + |> get("/api/v1/pleroma/birthdays?day=12&month=2") |> json_response_and_validate_schema(:ok) end end -- cgit v1.2.3 From e3d394eef64f96210b144c40d3055d0662da7109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 23 Jan 2022 09:41:21 +0100 Subject: Birthdays: Fix tests, add test for misskey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/fixtures/birthdays/misskey-user.json | 1 + test/pleroma/web/activity_pub/activity_pub_test.exs | 20 ++++++++++++++++++++ .../web/mastodon_api/update_credentials_test.exs | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/birthdays/misskey-user.json (limited to 'test') diff --git a/test/fixtures/birthdays/misskey-user.json b/test/fixtures/birthdays/misskey-user.json new file mode 100644 index 000000000..4ffee3910 --- /dev/null +++ b/test/fixtures/birthdays/misskey-user.json @@ -0,0 +1 @@ +{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","Hashtag":"as:Hashtag","quoteUrl":"as:quoteUrl","toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":"toot:featured","discoverable":"toot:discoverable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey.io/ns#","_misskey_content":"misskey:_misskey_content","_misskey_quote":"misskey:_misskey_quote","_misskey_reaction":"misskey:_misskey_reaction","_misskey_votes":"misskey:_misskey_votes","_misskey_talk":"misskey:_misskey_talk","isCat":"misskey:isCat","vcard":"http://www.w3.org/2006/vcard/ns#"}],"type":"Person","id":"https://misskey.io/users/8dhi2ne167","inbox":"https://misskey.io/users/8dhi2ne167/inbox","outbox":"https://misskey.io/users/8dhi2ne167/outbox","followers":"https://misskey.io/users/8dhi2ne167/followers","following":"https://misskey.io/users/8dhi2ne167/following","sharedInbox":"https://misskey.io/inbox","endpoints":{"sharedInbox":"https://misskey.io/inbox"},"url":"https://misskey.io/@mkljczk","preferredUsername":"mkljczk","name":null,"summary":null,"icon":null,"image":null,"tag":[],"manuallyApprovesFollowers":false,"discoverable":true,"publicKey":{"id":"https://misskey.io/users/8dhi2ne167#main-key","type":"Key","owner":"https://misskey.io/users/8dhi2ne167","publicKeyPem":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA7CI3Ol1M0TDdLL+E8Uhd\nJ8l/RTEtxl39MKxsqSCZr9itf/EBn4dGTifK9LN3XZD2fjmX4hdwaxndp2HYVDqn\ndc6O57u8dHxFv9wTwXQrLzEonOzbrBec6WB42ZpkFHi4XEyqg8iYGu5Yy7ttXJ21\nOfWqi+eytttcTErKuu4z8MX1L1IlmpfSmH1trMyDZLFMRqVJ0416/qI0K3l3cmIf\n8cuWbJ57UxVbYxp9242der/3vrNIU24rAouYQYe1atUgFPKil3w8dCY7magy36Wg\nOXC1hdRsFcsVW54/3cSQ9fc/+1HIg16/zlS+AWb4dVDhrAUJLYIBrkMPRnu/cDuI\ndvyL+KtZUxhDBoSO0JLrd1+GZGt0WD+mfutCugJS8IGlWQmGq8WRmM2vYfZgEYkq\nCv4392VSsWvg4iluKz0eX+8l7QKHseJwGBvk89Txlz6f7QkooBXYuuyHZS1ZLZBW\nfooK+RNAquDU+cVUu1gVt1V5yt3IxF1qvMRtlElNJKN5NUJT9/K2YcVX6UoMXhDd\noSOpARqPm9E2pdjI62pAOBbCplMSoBprhoCYm0iozf9QhNyUBGWDcTsFDDgqOwy4\nYjGQ5jsnCrkhSzRkTViWD+Pgw+Ar4fxcjySGUf0x7HkNfteDPSdLMD8J2vTJXfoB\nGAQQmGMZmFgONC62FrDphlsCAwEAAQ==\n-----END PUBLIC KEY-----\n"},"isCat":true,"vcard:bday":"2001-02-12"} \ No newline at end of file diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index 3d152b4d0..9789d7704 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -389,6 +389,26 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert %{data: %{"id" => ^object_url}} = Object.get_by_ap_id(object_url) end + + test "fetches user birthday information from misskey" do + user_id = "https://misskey.io/@mkljczk" + + Tesla.Mock.mock(fn + %{ + method: :get, + url: ^user_id + } -> + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/birthdays/misskey-user.json"), + headers: [{"content-type", "application/activity+json"}] + } + end) + + {:ok, user} = ActivityPub.make_user_from_ap_id(user_id) + + assert user.birthday == ~D[2001-02-12] + end end test "it fetches the appropriate tag-restricted posts" do diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index 9073cd771..f0618885a 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -387,7 +387,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do }) assert user_data = json_response_and_validate_schema(res, 200) - assert user_data["pleroma"]["source"]["show_birthday"] == true + assert user_data["source"]["pleroma"]["show_birthday"] == true end test "emojis in fields labels", %{conn: conn} do -- cgit v1.2.3 From 75c4fefb1c3a8e4ce21661cbd634c608365354ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 23 Jan 2022 12:50:34 +0100 Subject: Add a test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/user_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 0345a9290..a5a9021f6 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -2084,6 +2084,17 @@ defmodule Pleroma.UserTest do assert user.ap_id in ap_ids assert user_two.ap_id in ap_ids end + + test "it returns a list of AP ids in the same order" do + user = insert(:user) + user_two = insert(:user) + user_three = insert(:user) + + ap_ids = + User.get_ap_ids_by_nicknames([user.nickname, user_three.nickname, user_two.nickname]) + + assert [user.ap_id, user_three.ap_id, user_two.ap_id] == ap_ids + end end describe "sync followers count" do -- cgit v1.2.3 From 267184b70e587a3e6301d3a01bd16fd465bc0f68 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 24 Jan 2022 20:03:43 -0600 Subject: ForceMentionsInContentTest: return mentions in a not terrible format --- .../mrf/force_mentions_in_content_test.exs | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 090bdc35e..3c40887c4 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -8,17 +8,29 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do use Pleroma.DataCase test "adds mentions to post content" do - users = %{ - "lain@lain.com" => "https://lain.com/users/lain", - "coolboymew@shitposter.club" => "https://shitposter.club/users/coolboymew", - "dielan@shitposter.club" => "https://shitposter.club/users/dielan", - "hakui@tuusin.misono-ya.info" => "https://tuusin.misono-ya.info/users/hakui", - "fence@xyzzy.link" => "https://xyzzy.link/users/fence" - } - - Enum.each(users, fn {nickname, ap_id} -> - insert(:user, ap_id: ap_id, nickname: nickname, local: false) - end) + [lain, coolboymew, dielan, hakui, fence] = [ + insert(:user, ap_id: "https://lain.com/users/lain", nickname: "lain@lain.com", local: false), + insert(:user, + ap_id: "https://shitposter.club/users/coolboymew", + nickname: "coolboymew@shitposter.club", + local: false + ), + insert(:user, + ap_id: "https://shitposter.club/users/dielan", + nickname: "dielan@shitposter.club", + local: false + ), + insert(:user, + ap_id: "https://tuusin.misono-ya.info/users/hakui", + nickname: "hakui@tuusin.misono-ya.info", + local: false + ), + insert(:user, + ap_id: "https://xyzzy.link/users/fence", + nickname: "fence@xyzzy.link", + local: false + ) + ] object = File.read!("test/fixtures/soapbox_no_mentions_in_content.json") |> Jason.decode!() @@ -29,6 +41,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do } {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) - Enum.each(users, fn {nickname, _} -> assert filtered =~ nickname end) + + assert filtered == + "@lain @coolboymew @dielan @hakui @fence

Haha yeah, you can control who you reply to.

" end end -- cgit v1.2.3 From ab12a05a432be549b02e3fd84e4e30680a89bbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 25 Jan 2022 17:10:40 +0100 Subject: AccountView: Add test for show_birthday MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../web/mastodon_api/views/account_view_test.exs | 36 ++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 329813994..9fc56f7f0 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -79,7 +79,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: ["https://shitposter.zone/users/shp"], background_image: "https://example.com/images/asuka_hospital.png", - birthday: nil, favicon: nil, is_confirmed: true, tags: [], @@ -182,7 +181,6 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do ap_id: user.ap_id, also_known_as: [], background_image: nil, - birthday: nil, favicon: nil, is_confirmed: true, tags: [], @@ -496,6 +494,40 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do end end + describe "hiding birthday" do + test "doesn't show birthday if hidden" do + user = + insert(:user, %{ + birthday: "2001-02-12", + show_birthday: false + }) + + other_user = insert(:user) + + user = User.get_cached_by_ap_id(user.ap_id) + + assert AccountView.render( + "show.json", + %{user: user, for: other_user} + )[:birthday] == nil + end + + test "shows hidden birthday to the account owner" do + user = + insert(:user, %{ + birthday: "2001-02-12", + show_birthday: false + }) + + user = User.get_cached_by_ap_id(user.ap_id) + + assert AccountView.render( + "show.json", + %{user: user, for: user} + )[:birthday] == nil + end + end + describe "follow requests counter" do test "shows zero when no follow requests are pending" do user = insert(:user) -- cgit v1.2.3 From 65b4d2ce8450098ee2eaa2057968a4f47aa536c1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 25 Jan 2022 10:42:34 -0600 Subject: ForceMentionsInContent: fix order of mentions --- .../mrf/force_mentions_in_content_test.exs | 44 +++++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 3c40887c4..3bc07be94 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -3,9 +3,15 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do + use Pleroma.DataCase + require Pleroma.Constants + + alias Pleroma.Constants + alias Pleroma.Object alias Pleroma.Web.ActivityPub.MRF.ForceMentionsInContent + alias Pleroma.Web.CommonAPI + import Pleroma.Factory - use Pleroma.DataCase test "adds mentions to post content" do [lain, coolboymew, dielan, hakui, fence] = [ @@ -43,6 +49,40 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) assert filtered == - "@lain @coolboymew @dielan @hakui @fence

Haha yeah, you can control who you reply to.

" + "@dielan @coolboymew @fence @hakui @lain

Haha yeah, you can control who you reply to.

" + end + + test "the replied-to user is sorted to the left" do + [mario, luigi, wario] = [ + insert(:user, nickname: "mario"), + insert(:user, nickname: "luigi"), + insert(:user, nickname: "wario") + ] + + {:ok, post1} = CommonAPI.post(mario, %{status: "Letsa go!"}) + + {:ok, post2} = + CommonAPI.post(luigi, %{status: "Oh yaah", in_reply_to_id: post1.id, to: [mario.ap_id]}) + + activity = %{ + "type" => "Create", + "actor" => wario.ap_id, + "object" => %{ + "type" => "Note", + "actor" => wario.ap_id, + "content" => "WHA-HA!", + "to" => [ + mario.ap_id, + luigi.ap_id, + Constants.as_public() + ], + "inReplyTo" => Object.normalize(post2).data["id"] + } + } + + {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) + + assert filtered == + "@luigi @mario WHA-HA!" end end -- cgit v1.2.3 From 0604b0dd091682727d26567e6166fb89db842a9c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 25 Jan 2022 12:33:26 -0600 Subject: ForceMentionsInContent: don't mention self --- .../mrf/force_mentions_in_content_test.exs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 3bc07be94..589e8fdfb 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -85,4 +85,28 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do assert filtered == "@luigi @mario WHA-HA!" end + + test "don't mention self" do + mario = insert(:user, nickname: "mario") + + {:ok, post} = CommonAPI.post(mario, %{status: "Mama mia"}) + + activity = %{ + "type" => "Create", + "actor" => mario.ap_id, + "object" => %{ + "type" => "Note", + "actor" => mario.ap_id, + "content" => "I'ma tired...", + "to" => [ + mario.ap_id, + Constants.as_public() + ], + "inReplyTo" => Object.normalize(post).data["id"] + } + } + + {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) + assert filtered == "I'ma tired..." + end end -- cgit v1.2.3 From 27cb3d62738f6ea174994f72688497db49cef754 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 26 Jan 2022 21:24:26 -0600 Subject: ForceMentionsInContent: don't apply it to top-level posts --- .../mrf/force_mentions_in_content_test.exs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 589e8fdfb..6bcf75a92 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -109,4 +109,29 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) assert filtered == "I'ma tired..." end + + test "don't mention in top-level posts" do + mario = insert(:user, nickname: "mario") + luigi = insert(:user, nickname: "luigi") + + {:ok, post} = CommonAPI.post(mario, %{status: "Letsa go"}) + + activity = %{ + "type" => "Create", + "actor" => mario.ap_id, + "object" => %{ + "type" => "Note", + "actor" => mario.ap_id, + "content" => "Mama mia!", + "to" => [ + luigi.ap_id, + Constants.as_public() + ], + "quoteUrl" => Object.normalize(post).data["id"] + } + } + + {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) + assert filtered == "Mama mia!" + end end -- cgit v1.2.3 From 3bf257171f546ef84993b08851c01cf064309017 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 27 Jan 2022 14:15:06 -0600 Subject: ForceMentionsInContent: improve display of Markdown posts --- .../mrf/force_mentions_in_content_test.exs | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 6bcf75a92..669ec5251 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -49,7 +49,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) assert filtered == - "@dielan @coolboymew @fence @hakui @lain

Haha yeah, you can control who you reply to.

" + "

@dielan @coolboymew @fence @hakui @lain Haha yeah, you can control who you reply to.

" end test "the replied-to user is sorted to the left" do @@ -134,4 +134,31 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) assert filtered == "Mama mia!" end + + test "with markdown formatting" do + mario = insert(:user, nickname: "mario") + luigi = insert(:user, nickname: "luigi") + + {:ok, post} = CommonAPI.post(luigi, %{status: "Mama mia"}) + + activity = %{ + "type" => "Create", + "actor" => mario.ap_id, + "object" => %{ + "type" => "Note", + "actor" => mario.ap_id, + "content" => "

I'ma tired...

", + "to" => [ + luigi.ap_id, + Constants.as_public() + ], + "inReplyTo" => Object.normalize(post).data["id"] + } + } + + {:ok, %{"object" => %{"content" => filtered}}} = ForceMentionsInContent.filter(activity) + + assert filtered == + "

@luigi I'ma tired...

" + end end -- cgit v1.2.3 From 61dfeca1ccbff9d1fa1f3c1f709df9352573fffd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Feb 2022 10:38:30 -0600 Subject: Test that a Note from Roadhouse validates --- test/fixtures/roadhouse-create-activity.json | 109 +++++++++++++++++++++ .../article_note_page_validator_test.exs | 11 +++ 2 files changed, 120 insertions(+) create mode 100644 test/fixtures/roadhouse-create-activity.json (limited to 'test') diff --git a/test/fixtures/roadhouse-create-activity.json b/test/fixtures/roadhouse-create-activity.json new file mode 100644 index 000000000..c082f84d7 --- /dev/null +++ b/test/fixtures/roadhouse-create-activity.json @@ -0,0 +1,109 @@ +{ + "@context":[ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "zot":"https://macgirvin.com/apschema#", + "toot":"http://joinmastodon.org/ns#", + "ostatus":"http://ostatus.org#", + "schema":"http://schema.org#", + "litepub":"http://litepub.social/ns#", + "sm":"http://smithereen.software/ns#", + "conversation":"ostatus:conversation", + "manuallyApprovesFollowers":"as:manuallyApprovesFollowers", + "oauthRegistrationEndpoint":"litepub:oauthRegistrationEndpoint", + "sensitive":"as:sensitive", + "movedTo":"as:movedTo", + "copiedTo":"as:copiedTo", + "alsoKnownAs":"as:alsoKnownAs", + "EmojiReact":"as:EmojiReact", + "commentPolicy":"zot:commentPolicy", + "topicalCollection":"zot:topicalCollection", + "eventRepeat":"zot:eventRepeat", + "emojiReaction":"zot:emojiReaction", + "expires":"zot:expires", + "directMessage":"zot:directMessage", + "Category":"zot:Category", + "replyTo":"zot:replyTo", + "PropertyValue":"schema:PropertyValue", + "value":"schema:value", + "discoverable":"toot:discoverable", + "wall":"sm:wall", + "capabilities":"litepub:capabilities", + "acceptsJoins":"litepub:acceptsJoins" + } + ], + "type":"Create", + "id":"https://macgirvin.com/activity/ce9ce740-e1cb-4a75-aa4e-9e923555870d", + "published":"2022-02-02T04:41:46Z", + "context":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "conversation":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "actor":"https://macgirvin.com/channel/mike", + "replyTo":"https://macgirvin.com/channel/mike", + "url":"https://macgirvin.com/activity/ce9ce740-e1cb-4a75-aa4e-9e923555870d", + "object":{ + "type":"Note", + "id":"https://macgirvin.com/item/ce9ce740-e1cb-4a75-aa4e-9e923555870d", + "published":"2022-02-02T04:41:46Z", + "attributedTo":"https://macgirvin.com/channel/mike", + "inReplyTo":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "context":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "conversation":"https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "content":"The Accepts should get through now. Now to figure out why the comments are failing.", + "source":{ + "content":"The Accepts should get through now. Now to figure out why the comments are failing.", + "mediaType":"text/x-multicode" + }, + "replyTo":"https://macgirvin.com/channel/mike", + "url":"https://macgirvin.com/item/ce9ce740-e1cb-4a75-aa4e-9e923555870d", + "tag":[ + { + "type":"Mention", + "href":"https://gleasonator.com/users/macgirvin", + "name":"@macgirvin@gleasonator.com" + }, + { + "type":"Mention", + "href":"https://gleasonator.com/users/alex", + "name":"@alex@gleasonator.com" + } + ], + "to":[ + "https://www.w3.org/ns/activitystreams#Public", + "https://gleasonator.com/users/alex", + "https://gleasonator.com/users/macgirvin" + ], + "cc":[ + "https://macgirvin.com/followers/mike", + "https://gleasonator.com/users/macgirvin/followers" + ] + }, + "tag":[ + { + "type":"Mention", + "href":"https://gleasonator.com/users/macgirvin", + "name":"@macgirvin@gleasonator.com" + }, + { + "type":"Mention", + "href":"https://gleasonator.com/users/alex", + "name":"@alex@gleasonator.com" + } + ], + "to":[ + "https://www.w3.org/ns/activitystreams#Public", + "https://gleasonator.com/users/alex", + "https://gleasonator.com/users/macgirvin" + ], + "cc":[ + "https://macgirvin.com/followers/mike", + "https://gleasonator.com/users/macgirvin/followers" + ], + "signature":{ + "type":"RsaSignature2017", + "nonce":"544080164a412f0592f8257094a870a0177276f4a04cc4410974f5e8fa277a14", + "creator":"https://macgirvin.com/channel/mike", + "created":"2022-02-02T04:41:46Z", + "signatureValue":"BkHEdRkki/DGHctiI6BWyQdn0i9ip+7rFiqqlLgotgQzwA8wzcmyvFIRm8Z+3OqrbzkNyQLCmx4qHvkqWyNrR0eSSJPaBryYvTLpLBz5F5PSpHOI5x4kRGVaI2S1Po+pUMWgchyyQ8ylqdLVHe0FnqId7vFVo9uj4jWydU5wPGlbb5nvnRMQGGyPqzCJ69lopMgCRCUNgbOz6hYVU0Mhqgi9BDjs1crbRLoGexz87tu7FeGEmtyfz8/SBGrDy+X+U3ahykwqd7ggcptsYVu5BY7BfREOLNZE8BwapUCg+QSw9PJv7dLJytdh0kUrzpuAPNbugx7y662FALmHZlxcIC1IVwbPOwEiosDm6wXsOiIyTvnNFcvDre/B1corB2yt5wmO3Cu5jINvp4+aBTheGIKMxBvpJXywpWe6C0VBqfNZSreJtDwp9lHd6D1+L4V6hUCOqiCcqmLT/GI5TOR+EhSpJ02TOkuu+/8hyIfO6ec3uK98y8suyidckbfM60jrbvZh2s/kF9WlDsE9K+Jlyd9Xx3mI5jU+4MXo1MDA57zYpsXw0S+v++rvnOw8CkQr/opVdIRSCG+UB3VRinpgjwW1UQcdAI+fiVaAwqr45MgnIEaQdk13skJUfUl06D9IxKxhu7yNW1tR621w/HN+358qVQWWBoj+1ZhCG3Thjug=" + } +} diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs index 720c17d8d..150b26bea 100644 --- a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs @@ -32,4 +32,15 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) end end + + test "a Note from Roadhouse validates" do + insert(:user, ap_id: "https://macgirvin.com/channel/mike") + + %{"object" => note} = + "test/fixtures/roadhouse-create-activity.json" + |> File.read!() + |> Jason.decode!() + + %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) + end end -- cgit v1.2.3 From 5a4e3aa715fdd588b7fefc79dc15535497513218 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Feb 2022 11:02:23 -0600 Subject: Test that a Create/Note from Roadhouse validates --- .../create_generic_validator_test.exs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs (limited to 'test') diff --git a/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs new file mode 100644 index 000000000..94c9f6800 --- /dev/null +++ b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs @@ -0,0 +1,27 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidatorTest do + use Pleroma.DataCase, async: true + + alias Pleroma.Web.ActivityPub.ObjectValidator + alias Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidator + + import Pleroma.Factory + + test "a Create/Note from Roadhouse validates" do + insert(:user, ap_id: "https://macgirvin.com/channel/mike") + + note_activity = + "test/fixtures/roadhouse-create-activity.json" + |> File.read!() + |> Jason.decode!() + + # Build metadata + {:ok, object_data} = ObjectValidator.cast_and_apply(note_activity["object"]) + meta = [object_data: ObjectValidator.stringify_keys(object_data)] + + %{valid?: true} = CreateGenericValidator.cast_and_validate(note_activity, meta) + end +end -- cgit v1.2.3 From 2d779763055ebfe02ffb1ffced5c10dbc0baa63b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Feb 2022 12:19:35 -0600 Subject: Add tests for mismatched context in replies --- .../tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json | 35 ++++++++++++++++++ .../tesla_mock/macgirvin@gleasonator.com.json | 41 ++++++++++++++++++++++ .../create_generic_validator_test.exs | 32 +++++++++++++++++ .../web/activity_pub/transmogrifier_test.exs | 11 ++++++ test/support/http_request_mock.ex | 30 ++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json create mode 100644 test/fixtures/tesla_mock/macgirvin@gleasonator.com.json (limited to 'test') diff --git a/test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json b/test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json new file mode 100644 index 000000000..62d7bb9ae --- /dev/null +++ b/test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json @@ -0,0 +1,35 @@ +{ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://gleasonator.com/schemas/litepub-0.1.jsonld", + { + "@language": "und" + } + ], + "actor": "https://gleasonator.com/users/macgirvin", + "attachment": [], + "attributedTo": "https://gleasonator.com/users/macgirvin", + "cc": [ + "https://gleasonator.com/users/macgirvin/followers" + ], + "content": "@alex Any idea why my posts are failing? I sent an Accept/Follow from macgirvin.com at 2022-02-02T04:06:01Z and it vanished into space. As do all my comments to you.

2022-02-02T04:06:01Z:LOG_INFO:d5c4aa7f6a:Queue.php:435:deliver: deliver: queue post returned 200 from https://gleasonator.com/users/macgirvin/inbox

It's OK if I'm blocked, but if that's the case, I shouldn't be able to send a follow to that address should I?", + "context": "https://gleasonator.com/contexts/b7f01f94-bc92-4d89-a085-0ffc211b0e42", + "conversation": "https://gleasonator.com/contexts/b7f01f94-bc92-4d89-a085-0ffc211b0e42", + "id": "https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", + "published": "2022-02-02T04:14:10.965833Z", + "sensitive": false, + "source": "@alex Any idea why my posts are failing? I sent an Accept/Follow from macgirvin.com at 2022-02-02T04:06:01Z and it vanished into space. As do all my comments to you. \n\n2022-02-02T04:06:01Z:LOG_INFO:d5c4aa7f6a:Queue.php:435:deliver: deliver: queue post returned 200 from https://gleasonator.com/users/macgirvin/inbox\n\nIt's OK if I'm blocked, but if that's the case, I shouldn't be able to send a follow to that address should I?", + "summary": "", + "tag": [ + { + "href": "https://gleasonator.com/users/alex", + "name": "@alex", + "type": "Mention" + } + ], + "to": [ + "https://www.w3.org/ns/activitystreams#Public", + "https://gleasonator.com/users/alex" + ], + "type": "Note" +} diff --git a/test/fixtures/tesla_mock/macgirvin@gleasonator.com.json b/test/fixtures/tesla_mock/macgirvin@gleasonator.com.json new file mode 100644 index 000000000..9d7d47d40 --- /dev/null +++ b/test/fixtures/tesla_mock/macgirvin@gleasonator.com.json @@ -0,0 +1,41 @@ +{ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://gleasonator.com/schemas/litepub-0.1.jsonld", + { + "@language": "und" + } + ], + "alsoKnownAs": [], + "attachment": [], + "capabilities": { + "acceptsChatMessages": true + }, + "discoverable": false, + "endpoints": { + "oauthAuthorizationEndpoint": "https://gleasonator.com/oauth/authorize", + "oauthRegistrationEndpoint": "https://gleasonator.com/api/v1/apps", + "oauthTokenEndpoint": "https://gleasonator.com/oauth/token", + "sharedInbox": "https://gleasonator.com/inbox", + "uploadMedia": "https://gleasonator.com/api/ap/upload_media" + }, + "featured": "https://gleasonator.com/users/macgirvin/collections/featured", + "followers": "https://gleasonator.com/users/macgirvin/followers", + "following": "https://gleasonator.com/users/macgirvin/following", + "id": "https://gleasonator.com/users/macgirvin", + "inbox": "https://gleasonator.com/users/macgirvin/inbox", + "manuallyApprovesFollowers": false, + "name": "macgirvin", + "outbox": "https://gleasonator.com/users/macgirvin/outbox", + "preferredUsername": "macgirvin", + "publicKey": { + "id": "https://gleasonator.com/users/macgirvin#main-key", + "owner": "https://gleasonator.com/users/macgirvin", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0AUMgsQu87tLwoJjZfZu\nsj7NV0qt/THdK8aw4Ha2GZfNkwrep99AZ8gmCI+rr+N5vyETAARzG5/Qzr5bNTUx\nsc1fxFemhhi6sxzAv4qZ5AgvWQ4YPFWizSp5ZY1jpPHLOeF2IftMf8CwVI82PtD0\n7m7T6iUYA4vfvMp9LxVrzQA+CAtpsQxAejTGCt37yM9T2mEWqfmJQQHRIQ4brKBL\nI82sNbzk1cbTwCfH7vRNS/l1ND+vaUGGkDKtpRl56BLmt4picYL0avc+8oO7ebpc\n/zUoS8OOi+mpEzjv7TBrSirYEIGvIh3TKHWSPrpHpQTqj9xBQBy+AxXTWahQEO2M\ndQIDAQAB\n-----END PUBLIC KEY-----\n\n" + }, + "summary": "", + "tag": [], + "type": "Person", + "url": "https://gleasonator.com/users/macgirvin", + "vcard:bday": null +} diff --git a/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs index 94c9f6800..c3e6854e4 100644 --- a/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs @@ -7,6 +7,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidatorTest do alias Pleroma.Web.ActivityPub.ObjectValidator alias Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidator + alias Pleroma.Web.ActivityPub.Utils import Pleroma.Factory @@ -24,4 +25,35 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidatorTest do %{valid?: true} = CreateGenericValidator.cast_and_validate(note_activity, meta) end + + test "a Create/Note with mismatched context is invalid" do + user = insert(:user) + + note = %{ + "id" => Utils.generate_object_id(), + "type" => "Note", + "actor" => user.ap_id, + "to" => [user.follower_address], + "cc" => [], + "content" => "Hello world", + "context" => Utils.generate_context_id() + } + + note_activity = %{ + "id" => Utils.generate_activity_id(), + "type" => "Create", + "actor" => note["actor"], + "to" => note["to"], + "cc" => note["cc"], + "object" => note, + "published" => DateTime.utc_now() |> DateTime.to_iso8601(), + "context" => Utils.generate_context_id() + } + + # Build metadata + {:ok, object_data} = ObjectValidator.cast_and_apply(note_activity["object"]) + meta = [object_data: ObjectValidator.stringify_keys(object_data)] + + %{valid?: false} = CreateGenericValidator.cast_and_validate(note_activity, meta) + end end diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 06daf6a9f..41a30be0b 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -107,6 +107,17 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do assert activity.data["target"] == new_user.ap_id assert activity.data["type"] == "Move" end + + test "a reply with mismatched context is rejected" do + insert(:user, ap_id: "https://macgirvin.com/channel/mike") + + note_activity = + "test/fixtures/roadhouse-create-activity.json" + |> File.read!() + |> Jason.decode!() + + assert {:error, _} = Transmogrifier.handle_incoming(note_activity) + end end describe "prepare outgoing" do diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 94900dc14..b99d70cda 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -1311,6 +1311,36 @@ defmodule HttpRequestMock do }} end + def get("https://gleasonator.com/objects/102eb097-a18b-4cd5-abfc-f952efcb70bb", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/gleasonator-AG3RzWfwEKKrY63qj2.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://gleasonator.com/users/macgirvin", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/tesla_mock/macgirvin@gleasonator.com.json"), + headers: activitypub_object_headers() + }} + end + + def get("https://gleasonator.com/users/macgirvin/collections/featured", _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: + File.read!("test/fixtures/users_mock/masto_featured.json") + |> String.replace("{{domain}}", "gleasonator.com") + |> String.replace("{{nickname}}", "macgirvin"), + headers: activitypub_object_headers() + }} + end + def get(url, query, body, headers) do {:error, "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"} -- cgit v1.2.3 From bd81af731eb6c391f647e66847d01afdf374c673 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Feb 2022 12:29:53 -0600 Subject: Tag erratic test --- test/pleroma/web/admin_api/controllers/report_controller_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs index 99cc7bbd0..802a8c05f 100644 --- a/test/pleroma/web/admin_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -355,6 +355,7 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do } = note end + @tag :erratic test "it returns reports with notes", %{conn: conn, admin: admin} do conn = get(conn, "/api/pleroma/admin/reports") -- cgit v1.2.3 From d1cc9e4eaf7d361d9033aa4d823a8b9682d184ea Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 24 Jan 2022 19:03:10 +0100 Subject: Fix tests matching on "warn" Moving it to "warning" would break tests on 1.12.x --- test/pleroma/reverse_proxy_test.exs | 2 +- test/pleroma/web/common_api/utils_test.exs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/pleroma/reverse_proxy_test.exs b/test/pleroma/reverse_proxy_test.exs index a4dd8e99a..49ddf251d 100644 --- a/test/pleroma/reverse_proxy_test.exs +++ b/test/pleroma/reverse_proxy_test.exs @@ -130,7 +130,7 @@ defmodule Pleroma.ReverseProxyTest do assert capture_log(fn -> ReverseProxy.call(conn, "/stream-bytes/50", max_body_length: 30) end) =~ - "[warn] Elixir.Pleroma.ReverseProxy request to /stream-bytes/50 failed while reading/chunking: :body_too_large" + "Elixir.Pleroma.ReverseProxy request to /stream-bytes/50 failed while reading/chunking: :body_too_large" end end diff --git a/test/pleroma/web/common_api/utils_test.exs b/test/pleroma/web/common_api/utils_test.exs index fc01f820a..7063b2503 100644 --- a/test/pleroma/web/common_api/utils_test.exs +++ b/test/pleroma/web/common_api/utils_test.exs @@ -309,7 +309,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert capture_log(fn -> assert Utils.date_to_asctime(date) == expected - end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601" + end) =~ "Date #{date} in wrong format, must be ISO 8601" end test "when date is a Unix timestamp" do @@ -319,7 +319,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert capture_log(fn -> assert Utils.date_to_asctime(date) == expected - end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601" + end) =~ "Date #{date} in wrong format, must be ISO 8601" end test "when date is nil" do @@ -327,13 +327,13 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert capture_log(fn -> assert Utils.date_to_asctime(nil) == expected - end) =~ "[warn] Date in wrong format, must be ISO 8601" + end) =~ "Date in wrong format, must be ISO 8601" end test "when date is a random string" do assert capture_log(fn -> assert Utils.date_to_asctime("foo") == "" - end) =~ "[warn] Date foo in wrong format, must be ISO 8601" + end) =~ "Date foo in wrong format, must be ISO 8601" end end -- cgit v1.2.3 From 7c044a1841810d0b9ceef5dc9813c14d49699ee4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 2 Feb 2022 13:10:39 -0600 Subject: FilterControllerTest: tag erratic test --- test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index 5ed1f34b7..d8fc2400b 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -177,6 +177,7 @@ defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do assert response["whole_word"] == true end + @tag :erratic test "with adding expires_at", %{conn: conn, user: user} do filter = insert(:filter, user: user) in_seconds = 600 -- cgit v1.2.3 From e473bcf7a0390584377d89ff68267a25fe31e44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 6 Feb 2022 17:41:15 +0100 Subject: Max media attachment count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/web/common_api_test.exs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 4b186ccfc..16af4b923 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -683,6 +683,32 @@ defmodule Pleroma.Web.CommonAPITest do assert {:ok, _activity} = CommonAPI.post(user, %{status: "12345"}) end + test "it validates media attachment limits are correctly enforced" do + clear_config([:instance, :max_media_attachments], 4) + + user = insert(:user) + + file = %Plug.Upload{ + content_type: "image/jpeg", + path: Path.absname("test/fixtures/image.jpg"), + filename: "an_image.jpg" + } + + {:ok, upload} = ActivityPub.upload(file, actor: user.ap_id) + + assert {:error, "Too many attachments"} = + CommonAPI.post(user, %{ + status: "", + media_ids: List.duplicate(upload.id, 5) + }) + + assert {:ok, _activity} = + CommonAPI.post(user, %{ + status: "", + media_ids: [upload.id] + }) + end + test "it can handle activities that expire" do user = insert(:user) -- cgit v1.2.3 From 061cb749cdcd30dc6c03f7d6a9c89b4b04860f85 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Mon, 21 Feb 2022 12:28:33 -0600 Subject: Add unicode 14 support and add a test with a unicode 14 emoji --- test/pleroma/emoji_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/emoji_test.exs b/test/pleroma/emoji_test.exs index 027a8132f..bd217b876 100644 --- a/test/pleroma/emoji_test.exs +++ b/test/pleroma/emoji_test.exs @@ -20,6 +20,7 @@ defmodule Pleroma.EmojiTest do assert Emoji.is_unicode_emoji?("🤰") assert Emoji.is_unicode_emoji?("❤️") assert Emoji.is_unicode_emoji?("🏳️‍⚧️") + assert Emoji.is_unicode_emoji?("🫵") # Additionally, we accept regional indicators. assert Emoji.is_unicode_emoji?("🇵") -- cgit v1.2.3 From 0fd3695b9c884cbc05f07c45249eb0e291cf6d1d Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Mon, 21 Feb 2022 17:54:18 -0500 Subject: Prefer userLanguage cookie over Accept-Language header in detecting locale https://git.pleroma.social/pleroma/pleroma-meta/-/issues/60 --- test/pleroma/web/plugs/set_locale_plug_test.exs | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index 5261e67ae..043d7eb18 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -33,6 +33,65 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do assert %{locale: "ru"} == conn.assigns end + test "use supported locale with specifiers from `accept-language`" do + conn = + :get + |> conn("/cofe") + |> Conn.put_req_header( + "accept-language", + "zh-Hans;q=0.9, en;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "zh_Hans" == Gettext.get_locale() + assert %{locale: "zh_Hans"} == conn.assigns + end + + test "use supported locale from cookie" do + conn = + :get + |> conn("/cofe") + |> put_req_cookie(SetLocalePlug.frontend_language_cookie_name(), "zh-Hans") + |> Conn.put_req_header( + "accept-language", + "ru, fr-CH, fr;q=0.9, en;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "zh_Hans" == Gettext.get_locale() + assert %{locale: "zh_Hans"} == conn.assigns + end + + test "fallback to supported locale from `accept-language` if locale in cookie not supported" do + conn = + :get + |> conn("/cofe") + |> put_req_cookie(SetLocalePlug.frontend_language_cookie_name(), "x-nonexist") + |> Conn.put_req_header( + "accept-language", + "ru, fr-CH, fr;q=0.9, en;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "ru" == Gettext.get_locale() + assert %{locale: "ru"} == conn.assigns + end + + test "fallback to default if nothing is supported" do + conn = + :get + |> conn("/cofe") + |> put_req_cookie(SetLocalePlug.frontend_language_cookie_name(), "x-nonexist") + |> Conn.put_req_header( + "accept-language", + "x-nonexist" + ) + |> SetLocalePlug.call([]) + + assert "en" == Gettext.get_locale() + assert %{locale: "en"} == conn.assigns + end + test "use default locale if locale from `accept-language` is not supported" do conn = :get -- cgit v1.2.3 From 6ba93c2cb354eaf5d05fd0d997ee8116dbec5470 Mon Sep 17 00:00:00 2001 From: Ilja Date: Tue, 22 Feb 2022 18:56:26 +0100 Subject: Fix test get_user_apps/1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason I had a test who suddenly failed, mix test test/pleroma/web/o_auth/app_test.exs:54. A user has a list of applications and this test adds them and then sees if the list it gets back is the same as the apps it added. When I ran mix test a day before I didn't have this problem and when I pushed code today in a different MR, the pipeline succeeded (see https://git.pleroma.social/ilja/pleroma/-/jobs/205827), yet locally it failed. So it seems the test can sometimes succeed and sometimes fail, which makes it untrustworthy. The failure I see is because the returned list is in reverse order. I assume that's not per sé wrong. You just want to know if the apps you added are actually there. I fixed the test by first ordering the lists before comparing. AFAICT (and as far as that's relevant) the test got introduced in commit cb2a072e6252b7c3f6473f7cfd1af5c0ec732d7b --- test/pleroma/web/o_auth/app_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/o_auth/app_test.exs b/test/pleroma/web/o_auth/app_test.exs index a5223b0a5..3c5ca07ae 100644 --- a/test/pleroma/web/o_auth/app_test.exs +++ b/test/pleroma/web/o_auth/app_test.exs @@ -51,6 +51,6 @@ defmodule Pleroma.Web.OAuth.AppTest do insert(:oauth_app, user_id: user.id) ] - assert App.get_user_apps(user) == apps + assert Enum.sort(App.get_user_apps(user)) == Enum.sort(apps) end end -- cgit v1.2.3 From 17aa3644be13a31ff0e8da0275de049b58780470 Mon Sep 17 00:00:00 2001 From: Sean King Date: Fri, 25 Feb 2022 23:11:42 -0700 Subject: Copyright bump for 2022 --- test/credo/check/consistency/file_location.ex | 2 +- test/fixtures/config/temp.exported_from_db.secret.exs | 4 ++++ test/fixtures/config/temp.secret.exs | 2 +- test/fixtures/modules/good_mrf.ex | 4 ++++ test/fixtures/modules/runtime_module.ex | 2 +- test/mix/pleroma_test.exs | 2 +- test/mix/tasks/pleroma/app_test.exs | 2 +- test/mix/tasks/pleroma/config_test.exs | 2 +- test/mix/tasks/pleroma/count_statuses_test.exs | 2 +- test/mix/tasks/pleroma/database_test.exs | 2 +- test/mix/tasks/pleroma/digest_test.exs | 2 +- test/mix/tasks/pleroma/ecto/migrate_test.exs | 4 ++-- test/mix/tasks/pleroma/ecto/rollback_test.exs | 2 +- test/mix/tasks/pleroma/ecto_test.exs | 2 +- test/mix/tasks/pleroma/email_test.exs | 2 +- test/mix/tasks/pleroma/emoji_test.exs | 2 +- test/mix/tasks/pleroma/frontend_test.exs | 2 +- test/mix/tasks/pleroma/instance_test.exs | 2 +- test/mix/tasks/pleroma/refresh_counter_cache_test.exs | 2 +- test/mix/tasks/pleroma/relay_test.exs | 2 +- test/mix/tasks/pleroma/robots_txt_test.exs | 2 +- test/mix/tasks/pleroma/uploads_test.exs | 2 +- test/mix/tasks/pleroma/user_test.exs | 2 +- test/pleroma/activity/ir/topics_test.exs | 2 +- test/pleroma/activity/search_test.exs | 2 +- test/pleroma/activity_test.exs | 2 +- test/pleroma/application_requirements_test.exs | 2 +- test/pleroma/bbs/handler_test.exs | 2 +- test/pleroma/bookmark_test.exs | 2 +- test/pleroma/captcha_test.exs | 2 +- test/pleroma/chat/message_reference_test.exs | 2 +- test/pleroma/chat_test.exs | 2 +- test/pleroma/config/deprecation_warnings_test.exs | 2 +- test/pleroma/config/holder_test.exs | 2 +- test/pleroma/config/loader_test.exs | 2 +- test/pleroma/config/release_runtime_provider_test.exs | 4 ++++ test/pleroma/config/transfer_task_test.exs | 2 +- test/pleroma/config_db_test.exs | 2 +- test/pleroma/config_test.exs | 2 +- test/pleroma/conversation/participation_test.exs | 2 +- test/pleroma/conversation_test.exs | 2 +- test/pleroma/docs/generator_test.exs | 2 +- .../ecto_type/activity_pub/object_validators/date_time_test.exs | 2 +- .../ecto_type/activity_pub/object_validators/object_id_test.exs | 2 +- .../ecto_type/activity_pub/object_validators/recipients_test.exs | 2 +- .../ecto_type/activity_pub/object_validators/safe_text_test.exs | 2 +- test/pleroma/emails/admin_email_test.exs | 2 +- test/pleroma/emails/mailer_test.exs | 2 +- test/pleroma/emails/user_email_test.exs | 2 +- test/pleroma/emoji/formatter_test.exs | 2 +- test/pleroma/emoji/loader_test.exs | 2 +- test/pleroma/emoji/pack_test.exs | 2 +- test/pleroma/emoji_test.exs | 2 +- test/pleroma/filter_test.exs | 2 +- test/pleroma/following_relationship_test.exs | 2 +- test/pleroma/formatter_test.exs | 2 +- test/pleroma/frontend_test.exs | 2 +- test/pleroma/gun/connection_pool_test.exs | 2 +- test/pleroma/hashtag_test.exs | 2 +- test/pleroma/healthcheck_test.exs | 2 +- test/pleroma/html_test.exs | 2 +- test/pleroma/http/adapter_helper/gun_test.exs | 2 +- test/pleroma/http/adapter_helper/hackney_test.exs | 2 +- test/pleroma/http/adapter_helper_test.exs | 2 +- test/pleroma/http/ex_aws_test.exs | 2 +- test/pleroma/http/request_builder_test.exs | 2 +- test/pleroma/http/tzdata_test.exs | 2 +- test/pleroma/http_test.exs | 2 +- test/pleroma/instances/instance_test.exs | 2 +- test/pleroma/instances_test.exs | 2 +- test/pleroma/integration/federation_test.exs | 2 +- test/pleroma/integration/mastodon_websocket_test.exs | 2 +- test/pleroma/job_queue_monitor_test.exs | 2 +- test/pleroma/keys_test.exs | 2 +- test/pleroma/list_test.exs | 2 +- test/pleroma/marker_test.exs | 2 +- test/pleroma/mfa/backup_codes_test.exs | 2 +- test/pleroma/mfa/totp_test.exs | 2 +- test/pleroma/mfa_test.exs | 2 +- test/pleroma/migration_helper/notification_backfill_test.exs | 2 +- test/pleroma/moderation_log_test.exs | 2 +- test/pleroma/notification_test.exs | 2 +- test/pleroma/object/containment_test.exs | 2 +- test/pleroma/object/fetcher_test.exs | 2 +- test/pleroma/object_test.exs | 2 +- test/pleroma/otp_version_test.exs | 2 +- test/pleroma/pagination_test.exs | 2 +- test/pleroma/password/pbkdf2_test.exs | 2 +- test/pleroma/registration_test.exs | 2 +- test/pleroma/repo/migrations/autolinker_to_linkify_test.exs | 2 +- test/pleroma/repo/migrations/confirm_logged_in_users_test.exs | 2 +- test/pleroma/repo/migrations/deprecate_public_endpoint_test.exs | 2 +- test/pleroma/repo/migrations/fix_legacy_tags_test.exs | 2 +- test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs | 2 +- test/pleroma/repo/migrations/move_welcome_settings_test.exs | 2 +- test/pleroma/repo/migrations/rename_instance_chat_test.exs | 4 ++++ test/pleroma/repo_test.exs | 2 +- test/pleroma/report_note_test.exs | 2 +- test/pleroma/reverse_proxy_test.exs | 2 +- test/pleroma/runtime_test.exs | 2 +- test/pleroma/safe_jsonb_set_test.exs | 2 +- test/pleroma/scheduled_activity_test.exs | 2 +- test/pleroma/signature_test.exs | 2 +- test/pleroma/stats_test.exs | 2 +- test/pleroma/upload/filter/analyze_metadata_test.exs | 2 +- test/pleroma/upload/filter/anonymize_filename_test.exs | 2 +- test/pleroma/upload/filter/dedupe_test.exs | 2 +- test/pleroma/upload/filter/exiftool_test.exs | 2 +- test/pleroma/upload/filter/mogrifun_test.exs | 2 +- test/pleroma/upload/filter/mogrify_test.exs | 2 +- test/pleroma/upload/filter_test.exs | 2 +- test/pleroma/upload_test.exs | 2 +- test/pleroma/uploaders/local_test.exs | 2 +- test/pleroma/uploaders/s3_test.exs | 2 +- test/pleroma/user/backup_test.exs | 2 +- test/pleroma/user/import_test.exs | 2 +- test/pleroma/user/notification_setting_test.exs | 2 +- test/pleroma/user/query_test.exs | 2 +- test/pleroma/user/welcome_chat_message_test.exs | 2 +- test/pleroma/user/welcome_email_test.exs | 2 +- test/pleroma/user/welcome_message_test.exs | 2 +- test/pleroma/user_invite_token_test.exs | 2 +- test/pleroma/user_relationship_test.exs | 2 +- test/pleroma/user_search_test.exs | 2 +- test/pleroma/user_test.exs | 2 +- test/pleroma/utils_test.exs | 2 +- test/pleroma/web/activity_pub/activity_pub_controller_test.exs | 2 +- test/pleroma/web/activity_pub/activity_pub_test.exs | 2 +- test/pleroma/web/activity_pub/builder_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/follow_bot_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/hashtag_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/mention_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/simple_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/tag_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs | 2 +- test/pleroma/web/activity_pub/mrf_test.exs | 2 +- .../web/activity_pub/object_validators/accept_validation_test.exs | 2 +- .../web/activity_pub/object_validators/announce_validation_test.exs | 2 +- .../object_validators/article_note_page_validator_test.exs | 2 +- .../web/activity_pub/object_validators/attachment_validator_test.exs | 2 +- .../web/activity_pub/object_validators/block_validation_test.exs | 2 +- .../web/activity_pub/object_validators/chat_validation_test.exs | 2 +- .../activity_pub/object_validators/create_generic_validator_test.exs | 2 +- .../web/activity_pub/object_validators/delete_validation_test.exs | 2 +- .../web/activity_pub/object_validators/emoji_react_handling_test.exs | 2 +- .../web/activity_pub/object_validators/follow_validation_test.exs | 2 +- .../web/activity_pub/object_validators/like_validation_test.exs | 2 +- .../web/activity_pub/object_validators/reject_validation_test.exs | 2 +- .../pleroma/web/activity_pub/object_validators/undo_handling_test.exs | 2 +- .../web/activity_pub/object_validators/update_handling_test.exs | 2 +- test/pleroma/web/activity_pub/pipeline_test.exs | 2 +- test/pleroma/web/activity_pub/publisher_test.exs | 2 +- test/pleroma/web/activity_pub/relay_test.exs | 2 +- test/pleroma/web/activity_pub/side_effects/delete_test.exs | 2 +- test/pleroma/web/activity_pub/side_effects_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs | 2 +- .../web/activity_pub/transmogrifier/add_remove_handling_test.exs | 4 ++++ .../web/activity_pub/transmogrifier/announce_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs | 2 +- .../pleroma/web/activity_pub/transmogrifier/article_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs | 2 +- .../web/activity_pub/transmogrifier/emoji_react_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/page_handling_test.exs | 2 +- .../web/activity_pub/transmogrifier/question_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs | 2 +- .../web/activity_pub/transmogrifier/user_update_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs | 2 +- test/pleroma/web/activity_pub/transmogrifier_test.exs | 2 +- test/pleroma/web/activity_pub/utils_test.exs | 2 +- test/pleroma/web/activity_pub/views/object_view_test.exs | 2 +- test/pleroma/web/activity_pub/views/user_view_test.exs | 2 +- test/pleroma/web/activity_pub/visibility_test.exs | 2 +- test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/chat_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/config_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/frontend_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/instance_controller_test.exs | 2 +- .../web/admin_api/controllers/instance_document_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/invite_controller_test.exs | 2 +- .../web/admin_api/controllers/media_proxy_cache_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/relay_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/report_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/status_controller_test.exs | 2 +- test/pleroma/web/admin_api/controllers/user_controller_test.exs | 2 +- test/pleroma/web/admin_api/search_test.exs | 2 +- test/pleroma/web/admin_api/views/account_view_test.exs | 2 +- test/pleroma/web/admin_api/views/moderation_log_view_test.exs | 2 +- test/pleroma/web/admin_api/views/report_view_test.exs | 2 +- test/pleroma/web/api_spec/schema_examples_test.exs | 2 +- test/pleroma/web/auth/auth_controller_test.exs | 2 +- test/pleroma/web/auth/authenticator_test.exs | 2 +- test/pleroma/web/auth/basic_auth_test.exs | 2 +- test/pleroma/web/auth/pleroma_authenticator_test.exs | 2 +- test/pleroma/web/auth/totp_authenticator_test.exs | 2 +- test/pleroma/web/common_api/utils_test.exs | 2 +- test/pleroma/web/common_api_test.exs | 2 +- test/pleroma/web/endpoint/metrics_exporter_test.exs | 2 +- test/pleroma/web/fallback_test.exs | 2 +- test/pleroma/web/federator_test.exs | 2 +- test/pleroma/web/feed/tag_controller_test.exs | 2 +- test/pleroma/web/feed/user_controller_test.exs | 2 +- test/pleroma/web/manifest_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/account_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/app_controller_test.exs | 2 +- .../web/mastodon_api/controllers/conversation_controller_test.exs | 2 +- .../web/mastodon_api/controllers/custom_emoji_controller_test.exs | 2 +- .../web/mastodon_api/controllers/directory_controller_test.exs | 4 ++++ .../web/mastodon_api/controllers/domain_block_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs | 2 +- .../web/mastodon_api/controllers/follow_request_controller_test.exs | 2 +- .../pleroma/web/mastodon_api/controllers/instance_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/list_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/media_controller_test.exs | 2 +- .../web/mastodon_api/controllers/notification_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/report_controller_test.exs | 2 +- .../mastodon_api/controllers/scheduled_activity_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/search_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/controllers/status_controller_test.exs | 2 +- .../web/mastodon_api/controllers/subscription_controller_test.exs | 2 +- .../web/mastodon_api/controllers/suggestion_controller_test.exs | 2 +- .../pleroma/web/mastodon_api/controllers/timeline_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs | 2 +- test/pleroma/web/mastodon_api/mastodon_api_test.exs | 2 +- test/pleroma/web/mastodon_api/update_credentials_test.exs | 2 +- test/pleroma/web/mastodon_api/views/account_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/conversation_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/list_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/marker_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/notification_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/poll_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/status_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/subscription_view_test.exs | 2 +- test/pleroma/web/mastodon_api/views/suggestion_view_test.exs | 2 +- test/pleroma/web/media_proxy/invalidation/http_test.exs | 2 +- test/pleroma/web/media_proxy/invalidation/script_test.exs | 2 +- test/pleroma/web/media_proxy/invalidation_test.exs | 2 +- test/pleroma/web/media_proxy/media_proxy_controller_test.exs | 2 +- test/pleroma/web/media_proxy_test.exs | 2 +- test/pleroma/web/metadata/player_view_test.exs | 2 +- test/pleroma/web/metadata/providers/feed_test.exs | 2 +- test/pleroma/web/metadata/providers/open_graph_test.exs | 2 +- test/pleroma/web/metadata/providers/rel_me_test.exs | 2 +- test/pleroma/web/metadata/providers/restrict_indexing_test.exs | 2 +- test/pleroma/web/metadata/providers/twitter_card_test.exs | 2 +- test/pleroma/web/metadata/utils_test.exs | 2 +- test/pleroma/web/mongoose_im_controller_test.exs | 2 +- test/pleroma/web/node_info_test.exs | 2 +- test/pleroma/web/o_auth/app_test.exs | 2 +- test/pleroma/web/o_auth/authorization_test.exs | 2 +- test/pleroma/web/o_auth/ldap_authorization_test.exs | 2 +- test/pleroma/web/o_auth/mfa_controller_test.exs | 2 +- test/pleroma/web/o_auth/o_auth_controller_test.exs | 2 +- test/pleroma/web/o_auth/token/utils_test.exs | 2 +- test/pleroma/web/o_auth/token_test.exs | 2 +- test/pleroma/web/o_status/o_status_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/account_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/app_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs | 2 +- .../web/pleroma_api/controllers/conversation_controller_test.exs | 2 +- .../web/pleroma_api/controllers/emoji_file_controller_test.exs | 2 +- .../web/pleroma_api/controllers/emoji_pack_controller_test.exs | 2 +- .../web/pleroma_api/controllers/emoji_reaction_controller_test.exs | 2 +- .../pleroma/web/pleroma_api/controllers/instances_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs | 2 +- .../web/pleroma_api/controllers/notification_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/report_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs | 2 +- .../controllers/two_factor_authentication_controller_test.exs | 2 +- .../web/pleroma_api/controllers/user_import_controller_test.exs | 2 +- test/pleroma/web/pleroma_api/views/app_view_test.exs | 2 +- test/pleroma/web/pleroma_api/views/backup_view_test.exs | 2 +- .../web/pleroma_api/views/chat_message_reference_view_test.exs | 2 +- test/pleroma/web/pleroma_api/views/chat_view_test.exs | 2 +- test/pleroma/web/pleroma_api/views/scrobble_view_test.exs | 2 +- test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs | 2 +- test/pleroma/web/plugs/authentication_plug_test.exs | 2 +- test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs | 2 +- test/pleroma/web/plugs/cache_control_test.exs | 2 +- test/pleroma/web/plugs/cache_test.exs | 2 +- test/pleroma/web/plugs/digest_plug_test.exs | 4 ++++ test/pleroma/web/plugs/ensure_authenticated_plug_test.exs | 2 +- test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs | 2 +- test/pleroma/web/plugs/ensure_staff_privileged_plug_test.exs | 2 +- test/pleroma/web/plugs/ensure_user_token_assigns_plug_test.exs | 2 +- test/pleroma/web/plugs/federating_plug_test.exs | 2 +- test/pleroma/web/plugs/frontend_static_plug_test.exs | 2 +- test/pleroma/web/plugs/http_security_plug_test.exs | 2 +- test/pleroma/web/plugs/http_signature_plug_test.exs | 2 +- test/pleroma/web/plugs/idempotency_plug_test.exs | 2 +- test/pleroma/web/plugs/instance_static_test.exs | 2 +- test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs | 2 +- test/pleroma/web/plugs/o_auth_plug_test.exs | 2 +- test/pleroma/web/plugs/o_auth_scopes_plug_test.exs | 2 +- test/pleroma/web/plugs/plug_helper_test.exs | 2 +- test/pleroma/web/plugs/rate_limiter_test.exs | 2 +- test/pleroma/web/plugs/remote_ip_test.exs | 2 +- test/pleroma/web/plugs/set_format_plug_test.exs | 2 +- test/pleroma/web/plugs/set_locale_plug_test.exs | 2 +- test/pleroma/web/plugs/set_user_session_id_plug_test.exs | 2 +- test/pleroma/web/plugs/uploaded_media_plug_test.exs | 2 +- test/pleroma/web/plugs/user_enabled_plug_test.exs | 2 +- test/pleroma/web/plugs/user_fetcher_plug_test.exs | 2 +- test/pleroma/web/plugs/user_is_admin_plug_test.exs | 2 +- test/pleroma/web/plugs/user_is_staff_plug_test.exs | 2 +- test/pleroma/web/plugs/user_tracking_plug_test.exs | 2 +- test/pleroma/web/preload/providers/instance_test.exs | 2 +- test/pleroma/web/preload/providers/timeline_test.exs | 2 +- test/pleroma/web/preload/providers/user_test.exs | 2 +- test/pleroma/web/push/impl_test.exs | 2 +- test/pleroma/web/rel_me_test.exs | 2 +- test/pleroma/web/rich_media/helpers_test.exs | 2 +- test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs | 2 +- test/pleroma/web/rich_media/parser_test.exs | 2 +- test/pleroma/web/rich_media/parsers/twitter_card_test.exs | 2 +- test/pleroma/web/shout_channel_test.exs | 2 +- test/pleroma/web/static_fe/static_fe_controller_test.exs | 2 +- test/pleroma/web/streamer_test.exs | 2 +- test/pleroma/web/twitter_api/controller_test.exs | 2 +- test/pleroma/web/twitter_api/password_controller_test.exs | 2 +- test/pleroma/web/twitter_api/remote_follow_controller_test.exs | 2 +- test/pleroma/web/twitter_api/twitter_api_test.exs | 2 +- test/pleroma/web/twitter_api/util_controller_test.exs | 2 +- test/pleroma/web/uploader_controller_test.exs | 2 +- test/pleroma/web/views/error_view_test.exs | 2 +- test/pleroma/web/web_finger/web_finger_controller_test.exs | 2 +- test/pleroma/web/web_finger_test.exs | 2 +- test/pleroma/workers/cron/digest_emails_worker_test.exs | 2 +- test/pleroma/workers/cron/new_users_digest_worker_test.exs | 2 +- test/pleroma/workers/purge_expired_activity_test.exs | 2 +- test/pleroma/workers/purge_expired_filter_test.exs | 4 ++++ test/pleroma/workers/purge_expired_token_test.exs | 2 +- test/pleroma/workers/scheduled_activity_worker_test.exs | 2 +- test/pleroma/xml_builder_test.exs | 2 +- test/support/api_spec_helpers.ex | 2 +- test/support/builders/activity_builder.ex | 4 ++++ test/support/builders/user_builder.ex | 4 ++++ test/support/cachex_proxy.ex | 2 +- test/support/captcha/mock.ex | 2 +- test/support/channel_case.ex | 2 +- test/support/cluster.ex | 4 ++++ test/support/conn_case.ex | 2 +- test/support/data_case.ex | 2 +- test/support/factory.ex | 2 +- test/support/helpers.ex | 2 +- test/support/http_request_mock.ex | 2 +- test/support/mocks.ex | 2 +- test/support/mrf_module_mock.ex | 2 +- test/support/null_cache.ex | 2 +- test/support/oban_helpers.ex | 2 +- test/support/websocket_client.ex | 2 +- test/test_helper.exs | 2 +- 381 files changed, 415 insertions(+), 371 deletions(-) (limited to 'test') diff --git a/test/credo/check/consistency/file_location.ex b/test/credo/check/consistency/file_location.ex index abc55fffc..d6a62bfd2 100644 --- a/test/credo/check/consistency/file_location.ex +++ b/test/credo/check/consistency/file_location.ex @@ -1,7 +1,7 @@ # Pleroma: A lightweight social networking server # Originally taken from # https://github.com/VeryBigThings/elixir_common/blob/master/lib/vbt/credo/check/consistency/file_location.ex -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Credo.Check.Consistency.FileLocation do diff --git a/test/fixtures/config/temp.exported_from_db.secret.exs b/test/fixtures/config/temp.exported_from_db.secret.exs index dda5d0fa6..94782ec73 100644 --- a/test/fixtures/config/temp.exported_from_db.secret.exs +++ b/test/fixtures/config/temp.exported_from_db.secret.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + import Config config :pleroma, exported_config_merged: true diff --git a/test/fixtures/config/temp.secret.exs b/test/fixtures/config/temp.secret.exs index 9c5c88d98..d4140d0c4 100644 --- a/test/fixtures/config/temp.secret.exs +++ b/test/fixtures/config/temp.secret.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only import Config diff --git a/test/fixtures/modules/good_mrf.ex b/test/fixtures/modules/good_mrf.ex index 5afa1c1d1..3ddb74a83 100644 --- a/test/fixtures/modules/good_mrf.ex +++ b/test/fixtures/modules/good_mrf.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Fixtures.Modules.GoodMRF do @behaviour Pleroma.Web.ActivityPub.MRF.Policy diff --git a/test/fixtures/modules/runtime_module.ex b/test/fixtures/modules/runtime_module.ex index 940b58a1b..d28dd2f1a 100644 --- a/test/fixtures/modules/runtime_module.ex +++ b/test/fixtures/modules/runtime_module.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Fixtures.Modules.RuntimeModule do diff --git a/test/mix/pleroma_test.exs b/test/mix/pleroma_test.exs index af62cc1d9..c981ee9b9 100644 --- a/test/mix/pleroma_test.exs +++ b/test/mix/pleroma_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.PleromaTest do diff --git a/test/mix/tasks/pleroma/app_test.exs b/test/mix/tasks/pleroma/app_test.exs index 9eabd32af..f35447edc 100644 --- a/test/mix/tasks/pleroma/app_test.exs +++ b/test/mix/tasks/pleroma/app_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.AppTest do diff --git a/test/mix/tasks/pleroma/config_test.exs b/test/mix/tasks/pleroma/config_test.exs index 2b8252db7..f90ef8804 100644 --- a/test/mix/tasks/pleroma/config_test.exs +++ b/test/mix/tasks/pleroma/config_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.ConfigTest do diff --git a/test/mix/tasks/pleroma/count_statuses_test.exs b/test/mix/tasks/pleroma/count_statuses_test.exs index 80ec206b8..2fd515c39 100644 --- a/test/mix/tasks/pleroma/count_statuses_test.exs +++ b/test/mix/tasks/pleroma/count_statuses_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.CountStatusesTest do diff --git a/test/mix/tasks/pleroma/database_test.exs b/test/mix/tasks/pleroma/database_test.exs index 7a1a759da..fbc939171 100644 --- a/test/mix/tasks/pleroma/database_test.exs +++ b/test/mix/tasks/pleroma/database_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.DatabaseTest do diff --git a/test/mix/tasks/pleroma/digest_test.exs b/test/mix/tasks/pleroma/digest_test.exs index 4a9e461a9..0a25b508f 100644 --- a/test/mix/tasks/pleroma/digest_test.exs +++ b/test/mix/tasks/pleroma/digest_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.DigestTest do diff --git a/test/mix/tasks/pleroma/ecto/migrate_test.exs b/test/mix/tasks/pleroma/ecto/migrate_test.exs index 3bfdde1c0..912471f60 100644 --- a/test/mix/tasks/pleroma/ecto/migrate_test.exs +++ b/test/mix/tasks/pleroma/ecto/migrate_test.exs @@ -1,6 +1,6 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-onl +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.Ecto.MigrateTest do use Pleroma.DataCase diff --git a/test/mix/tasks/pleroma/ecto/rollback_test.exs b/test/mix/tasks/pleroma/ecto/rollback_test.exs index f8a37bd49..9d1a02ae2 100644 --- a/test/mix/tasks/pleroma/ecto/rollback_test.exs +++ b/test/mix/tasks/pleroma/ecto/rollback_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.Ecto.RollbackTest do diff --git a/test/mix/tasks/pleroma/ecto_test.exs b/test/mix/tasks/pleroma/ecto_test.exs index 0164da5a8..8c99eeefe 100644 --- a/test/mix/tasks/pleroma/ecto_test.exs +++ b/test/mix/tasks/pleroma/ecto_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.EctoTest do diff --git a/test/mix/tasks/pleroma/email_test.exs b/test/mix/tasks/pleroma/email_test.exs index ce68b88de..20b76ae3a 100644 --- a/test/mix/tasks/pleroma/email_test.exs +++ b/test/mix/tasks/pleroma/email_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.EmailTest do diff --git a/test/mix/tasks/pleroma/emoji_test.exs b/test/mix/tasks/pleroma/emoji_test.exs index bd20f285c..2e10bbdc8 100644 --- a/test/mix/tasks/pleroma/emoji_test.exs +++ b/test/mix/tasks/pleroma/emoji_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.EmojiTest do diff --git a/test/mix/tasks/pleroma/frontend_test.exs b/test/mix/tasks/pleroma/frontend_test.exs index aa4b25ebb..6d09f8e36 100644 --- a/test/mix/tasks/pleroma/frontend_test.exs +++ b/test/mix/tasks/pleroma/frontend_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.FrontendTest do diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs index 5a5a68053..249689ec6 100644 --- a/test/mix/tasks/pleroma/instance_test.exs +++ b/test/mix/tasks/pleroma/instance_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.InstanceTest do diff --git a/test/mix/tasks/pleroma/refresh_counter_cache_test.exs b/test/mix/tasks/pleroma/refresh_counter_cache_test.exs index fe9e5cfeb..66ffba40b 100644 --- a/test/mix/tasks/pleroma/refresh_counter_cache_test.exs +++ b/test/mix/tasks/pleroma/refresh_counter_cache_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.RefreshCounterCacheTest do diff --git a/test/mix/tasks/pleroma/relay_test.exs b/test/mix/tasks/pleroma/relay_test.exs index db75b3630..351fa9f4e 100644 --- a/test/mix/tasks/pleroma/relay_test.exs +++ b/test/mix/tasks/pleroma/relay_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.RelayTest do diff --git a/test/mix/tasks/pleroma/robots_txt_test.exs b/test/mix/tasks/pleroma/robots_txt_test.exs index 028aa4ccc..4426fe526 100644 --- a/test/mix/tasks/pleroma/robots_txt_test.exs +++ b/test/mix/tasks/pleroma/robots_txt_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.RobotsTxtTest do diff --git a/test/mix/tasks/pleroma/uploads_test.exs b/test/mix/tasks/pleroma/uploads_test.exs index a7d15e0fa..d4ea89501 100644 --- a/test/mix/tasks/pleroma/uploads_test.exs +++ b/test/mix/tasks/pleroma/uploads_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.UploadsTest do diff --git a/test/mix/tasks/pleroma/user_test.exs b/test/mix/tasks/pleroma/user_test.exs index a2178bbd1..4fdf6912b 100644 --- a/test/mix/tasks/pleroma/user_test.exs +++ b/test/mix/tasks/pleroma/user_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Mix.Tasks.Pleroma.UserTest do diff --git a/test/pleroma/activity/ir/topics_test.exs b/test/pleroma/activity/ir/topics_test.exs index 9c8e5d932..311f85dea 100644 --- a/test/pleroma/activity/ir/topics_test.exs +++ b/test/pleroma/activity/ir/topics_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Activity.Ir.TopicsTest do diff --git a/test/pleroma/activity/search_test.exs b/test/pleroma/activity/search_test.exs index 657fbc627..b8096fe73 100644 --- a/test/pleroma/activity/search_test.exs +++ b/test/pleroma/activity/search_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Activity.SearchTest do diff --git a/test/pleroma/activity_test.exs b/test/pleroma/activity_test.exs index 4f9144f91..b5bb4bafe 100644 --- a/test/pleroma/activity_test.exs +++ b/test/pleroma/activity_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ActivityTest do diff --git a/test/pleroma/application_requirements_test.exs b/test/pleroma/application_requirements_test.exs index a54c37968..2f5b049a3 100644 --- a/test/pleroma/application_requirements_test.exs +++ b/test/pleroma/application_requirements_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ApplicationRequirementsTest do diff --git a/test/pleroma/bbs/handler_test.exs b/test/pleroma/bbs/handler_test.exs index 3990f8286..aea3b6ead 100644 --- a/test/pleroma/bbs/handler_test.exs +++ b/test/pleroma/bbs/handler_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.BBS.HandlerTest do diff --git a/test/pleroma/bookmark_test.exs b/test/pleroma/bookmark_test.exs index 9f64a01c2..57144ded3 100644 --- a/test/pleroma/bookmark_test.exs +++ b/test/pleroma/bookmark_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.BookmarkTest do diff --git a/test/pleroma/captcha_test.exs b/test/pleroma/captcha_test.exs index fcb585112..ec4c713f8 100644 --- a/test/pleroma/captcha_test.exs +++ b/test/pleroma/captcha_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.CaptchaTest do diff --git a/test/pleroma/chat/message_reference_test.exs b/test/pleroma/chat/message_reference_test.exs index c8db3b450..ffbc1a614 100644 --- a/test/pleroma/chat/message_reference_test.exs +++ b/test/pleroma/chat/message_reference_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Chat.MessageReferenceTest do diff --git a/test/pleroma/chat_test.exs b/test/pleroma/chat_test.exs index a5fd1e02e..d18b3ff75 100644 --- a/test/pleroma/chat_test.exs +++ b/test/pleroma/chat_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ChatTest do diff --git a/test/pleroma/config/deprecation_warnings_test.exs b/test/pleroma/config/deprecation_warnings_test.exs index c5e2b20f4..202ec4b90 100644 --- a/test/pleroma/config/deprecation_warnings_test.exs +++ b/test/pleroma/config/deprecation_warnings_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Config.DeprecationWarningsTest do diff --git a/test/pleroma/config/holder_test.exs b/test/pleroma/config/holder_test.exs index ca4c38995..e801da5cf 100644 --- a/test/pleroma/config/holder_test.exs +++ b/test/pleroma/config/holder_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Config.HolderTest do diff --git a/test/pleroma/config/loader_test.exs b/test/pleroma/config/loader_test.exs index b34fd70da..095067e61 100644 --- a/test/pleroma/config/loader_test.exs +++ b/test/pleroma/config/loader_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Config.LoaderTest do diff --git a/test/pleroma/config/release_runtime_provider_test.exs b/test/pleroma/config/release_runtime_provider_test.exs index 6578d3268..4e0d4c838 100644 --- a/test/pleroma/config/release_runtime_provider_test.exs +++ b/test/pleroma/config/release_runtime_provider_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Config.ReleaseRuntimeProviderTest do use ExUnit.Case, async: true diff --git a/test/pleroma/config/transfer_task_test.exs b/test/pleroma/config/transfer_task_test.exs index 9e3f11f1a..927744add 100644 --- a/test/pleroma/config/transfer_task_test.exs +++ b/test/pleroma/config/transfer_task_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Config.TransferTaskTest do diff --git a/test/pleroma/config_db_test.exs b/test/pleroma/config_db_test.exs index d42123fb4..ea44b716f 100644 --- a/test/pleroma/config_db_test.exs +++ b/test/pleroma/config_db_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ConfigDBTest do diff --git a/test/pleroma/config_test.exs b/test/pleroma/config_test.exs index 3158a2ec8..697cf3223 100644 --- a/test/pleroma/config_test.exs +++ b/test/pleroma/config_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ConfigTest do diff --git a/test/pleroma/conversation/participation_test.exs b/test/pleroma/conversation/participation_test.exs index a25e17c95..6f71cc040 100644 --- a/test/pleroma/conversation/participation_test.exs +++ b/test/pleroma/conversation/participation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Conversation.ParticipationTest do diff --git a/test/pleroma/conversation_test.exs b/test/pleroma/conversation_test.exs index 1a947606d..94897e7ea 100644 --- a/test/pleroma/conversation_test.exs +++ b/test/pleroma/conversation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ConversationTest do diff --git a/test/pleroma/docs/generator_test.exs b/test/pleroma/docs/generator_test.exs index 8574c1d5e..92b4d13e4 100644 --- a/test/pleroma/docs/generator_test.exs +++ b/test/pleroma/docs/generator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Docs.GeneratorTest do diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs index 259fd6a5f..74441d1e8 100644 --- a/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs +++ b/test/pleroma/ecto_type/activity_pub/object_validators/date_time_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.DateTimeTest do diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs index 1a4c2dfcb..38bca41cf 100644 --- a/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs +++ b/test/pleroma/ecto_type/activity_pub/object_validators/object_id_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectIDTest do diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs index 4cdafa898..366039f25 100644 --- a/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs +++ b/test/pleroma/ecto_type/activity_pub/object_validators/recipients_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.RecipientsTest do diff --git a/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs b/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs index 7002eca30..2d13eb691 100644 --- a/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs +++ b/test/pleroma/ecto_type/activity_pub/object_validators/safe_text_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.SafeTextTest do diff --git a/test/pleroma/emails/admin_email_test.exs b/test/pleroma/emails/admin_email_test.exs index e65752c23..a10b7cfa7 100644 --- a/test/pleroma/emails/admin_email_test.exs +++ b/test/pleroma/emails/admin_email_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emails.AdminEmailTest do diff --git a/test/pleroma/emails/mailer_test.exs b/test/pleroma/emails/mailer_test.exs index a8e1553e5..7a718c653 100644 --- a/test/pleroma/emails/mailer_test.exs +++ b/test/pleroma/emails/mailer_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emails.MailerTest do diff --git a/test/pleroma/emails/user_email_test.exs b/test/pleroma/emails/user_email_test.exs index 21fd06ea6..e0f6fd83b 100644 --- a/test/pleroma/emails/user_email_test.exs +++ b/test/pleroma/emails/user_email_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emails.UserEmailTest do diff --git a/test/pleroma/emoji/formatter_test.exs b/test/pleroma/emoji/formatter_test.exs index 3942f609f..7bacea361 100644 --- a/test/pleroma/emoji/formatter_test.exs +++ b/test/pleroma/emoji/formatter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emoji.FormatterTest do diff --git a/test/pleroma/emoji/loader_test.exs b/test/pleroma/emoji/loader_test.exs index de89e3bc4..717424fc8 100644 --- a/test/pleroma/emoji/loader_test.exs +++ b/test/pleroma/emoji/loader_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emoji.LoaderTest do diff --git a/test/pleroma/emoji/pack_test.exs b/test/pleroma/emoji/pack_test.exs index ac7535412..18b99da75 100644 --- a/test/pleroma/emoji/pack_test.exs +++ b/test/pleroma/emoji/pack_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Emoji.PackTest do diff --git a/test/pleroma/emoji_test.exs b/test/pleroma/emoji_test.exs index bd217b876..18063c223 100644 --- a/test/pleroma/emoji_test.exs +++ b/test/pleroma/emoji_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.EmojiTest do diff --git a/test/pleroma/filter_test.exs b/test/pleroma/filter_test.exs index 19ad6b8c0..6d33cd22b 100644 --- a/test/pleroma/filter_test.exs +++ b/test/pleroma/filter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FilterTest do diff --git a/test/pleroma/following_relationship_test.exs b/test/pleroma/following_relationship_test.exs index 37452996b..70e443161 100644 --- a/test/pleroma/following_relationship_test.exs +++ b/test/pleroma/following_relationship_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FollowingRelationshipTest do diff --git a/test/pleroma/formatter_test.exs b/test/pleroma/formatter_test.exs index 6663fdbc6..5e431f6c9 100644 --- a/test/pleroma/formatter_test.exs +++ b/test/pleroma/formatter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FormatterTest do diff --git a/test/pleroma/frontend_test.exs b/test/pleroma/frontend_test.exs index 1b50a031d..c89c56c8c 100644 --- a/test/pleroma/frontend_test.exs +++ b/test/pleroma/frontend_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.FrontendTest do diff --git a/test/pleroma/gun/connection_pool_test.exs b/test/pleroma/gun/connection_pool_test.exs index 51637f541..e0c9e9904 100644 --- a/test/pleroma/gun/connection_pool_test.exs +++ b/test/pleroma/gun/connection_pool_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Gun.ConnectionPoolTest do diff --git a/test/pleroma/hashtag_test.exs b/test/pleroma/hashtag_test.exs index 0264dea0b..8531b1879 100644 --- a/test/pleroma/hashtag_test.exs +++ b/test/pleroma/hashtag_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HashtagTest do diff --git a/test/pleroma/healthcheck_test.exs b/test/pleroma/healthcheck_test.exs index 469e5b397..dc540c9be 100644 --- a/test/pleroma/healthcheck_test.exs +++ b/test/pleroma/healthcheck_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HealthcheckTest do diff --git a/test/pleroma/html_test.exs b/test/pleroma/html_test.exs index fe1a1ed57..970baf63b 100644 --- a/test/pleroma/html_test.exs +++ b/test/pleroma/html_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTMLTest do diff --git a/test/pleroma/http/adapter_helper/gun_test.exs b/test/pleroma/http/adapter_helper/gun_test.exs index cfb68557d..7515f4e79 100644 --- a/test/pleroma/http/adapter_helper/gun_test.exs +++ b/test/pleroma/http/adapter_helper/gun_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.AdapterHelper.GunTest do diff --git a/test/pleroma/http/adapter_helper/hackney_test.exs b/test/pleroma/http/adapter_helper/hackney_test.exs index 85150a65c..35d6c49a9 100644 --- a/test/pleroma/http/adapter_helper/hackney_test.exs +++ b/test/pleroma/http/adapter_helper/hackney_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.AdapterHelper.HackneyTest do diff --git a/test/pleroma/http/adapter_helper_test.exs b/test/pleroma/http/adapter_helper_test.exs index 3c8c89164..e3c78f317 100644 --- a/test/pleroma/http/adapter_helper_test.exs +++ b/test/pleroma/http/adapter_helper_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.AdapterHelperTest do diff --git a/test/pleroma/http/ex_aws_test.exs b/test/pleroma/http/ex_aws_test.exs index 4cbc440bd..2bf3415b8 100644 --- a/test/pleroma/http/ex_aws_test.exs +++ b/test/pleroma/http/ex_aws_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.ExAwsTest do diff --git a/test/pleroma/http/request_builder_test.exs b/test/pleroma/http/request_builder_test.exs index 433beaac1..0f1ec7468 100644 --- a/test/pleroma/http/request_builder_test.exs +++ b/test/pleroma/http/request_builder_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.RequestBuilderTest do diff --git a/test/pleroma/http/tzdata_test.exs b/test/pleroma/http/tzdata_test.exs index 1161bfaef..9c260fbf7 100644 --- a/test/pleroma/http/tzdata_test.exs +++ b/test/pleroma/http/tzdata_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTP.TzdataTest do diff --git a/test/pleroma/http_test.exs b/test/pleroma/http_test.exs index e6a6d31b3..de359e599 100644 --- a/test/pleroma/http_test.exs +++ b/test/pleroma/http_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTTPTest do diff --git a/test/pleroma/instances/instance_test.exs b/test/pleroma/instances/instance_test.exs index e49922724..861519bce 100644 --- a/test/pleroma/instances/instance_test.exs +++ b/test/pleroma/instances/instance_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Instances.InstanceTest do diff --git a/test/pleroma/instances_test.exs b/test/pleroma/instances_test.exs index 03f9e4e97..96fa9cffe 100644 --- a/test/pleroma/instances_test.exs +++ b/test/pleroma/instances_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.InstancesTest do diff --git a/test/pleroma/integration/federation_test.exs b/test/pleroma/integration/federation_test.exs index da433e2c0..5b00ba5ba 100644 --- a/test/pleroma/integration/federation_test.exs +++ b/test/pleroma/integration/federation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Integration.FederationTest do diff --git a/test/pleroma/integration/mastodon_websocket_test.exs b/test/pleroma/integration/mastodon_websocket_test.exs index 43ec57893..2d4c7f63b 100644 --- a/test/pleroma/integration/mastodon_websocket_test.exs +++ b/test/pleroma/integration/mastodon_websocket_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Integration.MastodonWebsocketTest do diff --git a/test/pleroma/job_queue_monitor_test.exs b/test/pleroma/job_queue_monitor_test.exs index eebf602c5..f2056990f 100644 --- a/test/pleroma/job_queue_monitor_test.exs +++ b/test/pleroma/job_queue_monitor_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.JobQueueMonitorTest do diff --git a/test/pleroma/keys_test.exs b/test/pleroma/keys_test.exs index 9a15bf06e..1db36de8b 100644 --- a/test/pleroma/keys_test.exs +++ b/test/pleroma/keys_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.KeysTest do diff --git a/test/pleroma/list_test.exs b/test/pleroma/list_test.exs index 7e66ad385..a68146b0d 100644 --- a/test/pleroma/list_test.exs +++ b/test/pleroma/list_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ListTest do diff --git a/test/pleroma/marker_test.exs b/test/pleroma/marker_test.exs index 5f87a1c38..819dde9be 100644 --- a/test/pleroma/marker_test.exs +++ b/test/pleroma/marker_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MarkerTest do diff --git a/test/pleroma/mfa/backup_codes_test.exs b/test/pleroma/mfa/backup_codes_test.exs index 59f984e32..d05d735cf 100644 --- a/test/pleroma/mfa/backup_codes_test.exs +++ b/test/pleroma/mfa/backup_codes_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFA.BackupCodesTest do diff --git a/test/pleroma/mfa/totp_test.exs b/test/pleroma/mfa/totp_test.exs index 828993866..56e4f48ed 100644 --- a/test/pleroma/mfa/totp_test.exs +++ b/test/pleroma/mfa/totp_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFA.TOTPTest do diff --git a/test/pleroma/mfa_test.exs b/test/pleroma/mfa_test.exs index 76ba1a99d..e9c0c8837 100644 --- a/test/pleroma/mfa_test.exs +++ b/test/pleroma/mfa_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MFATest do diff --git a/test/pleroma/migration_helper/notification_backfill_test.exs b/test/pleroma/migration_helper/notification_backfill_test.exs index fd253b530..6d47bb6a8 100644 --- a/test/pleroma/migration_helper/notification_backfill_test.exs +++ b/test/pleroma/migration_helper/notification_backfill_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.MigrationHelper.NotificationBackfillTest do diff --git a/test/pleroma/moderation_log_test.exs b/test/pleroma/moderation_log_test.exs index 607301815..584b8708b 100644 --- a/test/pleroma/moderation_log_test.exs +++ b/test/pleroma/moderation_log_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ModerationLogTest do diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs index 716af496d..340a5f841 100644 --- a/test/pleroma/notification_test.exs +++ b/test/pleroma/notification_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.NotificationTest do diff --git a/test/pleroma/object/containment_test.exs b/test/pleroma/object/containment_test.exs index fb2fb7d49..cf906ef47 100644 --- a/test/pleroma/object/containment_test.exs +++ b/test/pleroma/object/containment_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Object.ContainmentTest do diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs index bd0a6e497..98130f434 100644 --- a/test/pleroma/object/fetcher_test.exs +++ b/test/pleroma/object/fetcher_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Object.FetcherTest do diff --git a/test/pleroma/object_test.exs b/test/pleroma/object_test.exs index 8320660a5..d536e0b16 100644 --- a/test/pleroma/object_test.exs +++ b/test/pleroma/object_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ObjectTest do diff --git a/test/pleroma/otp_version_test.exs b/test/pleroma/otp_version_test.exs index 736d440af..642cd1310 100644 --- a/test/pleroma/otp_version_test.exs +++ b/test/pleroma/otp_version_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.OTPVersionTest do diff --git a/test/pleroma/pagination_test.exs b/test/pleroma/pagination_test.exs index bc26c8b46..f241a21d5 100644 --- a/test/pleroma/pagination_test.exs +++ b/test/pleroma/pagination_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.PaginationTest do diff --git a/test/pleroma/password/pbkdf2_test.exs b/test/pleroma/password/pbkdf2_test.exs index e55348f9a..02f59445c 100644 --- a/test/pleroma/password/pbkdf2_test.exs +++ b/test/pleroma/password/pbkdf2_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Password.Pbkdf2Test do diff --git a/test/pleroma/registration_test.exs b/test/pleroma/registration_test.exs index 6e4ad9487..89992ec26 100644 --- a/test/pleroma/registration_test.exs +++ b/test/pleroma/registration_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.RegistrationTest do diff --git a/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs b/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs index a7d4d493c..52a606368 100644 --- a/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs +++ b/test/pleroma/repo/migrations/autolinker_to_linkify_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.AutolinkerToLinkifyTest do diff --git a/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs b/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs index 99d17f62a..a0731f5a4 100644 --- a/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs +++ b/test/pleroma/repo/migrations/confirm_logged_in_users_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsersTest do diff --git a/test/pleroma/repo/migrations/deprecate_public_endpoint_test.exs b/test/pleroma/repo/migrations/deprecate_public_endpoint_test.exs index 2ffc1b145..d19ffd69b 100644 --- a/test/pleroma/repo/migrations/deprecate_public_endpoint_test.exs +++ b/test/pleroma/repo/migrations/deprecate_public_endpoint_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.DeprecatePublicEndpointTest do diff --git a/test/pleroma/repo/migrations/fix_legacy_tags_test.exs b/test/pleroma/repo/migrations/fix_legacy_tags_test.exs index 0a1d1d0bb..21fdee1ab 100644 --- a/test/pleroma/repo/migrations/fix_legacy_tags_test.exs +++ b/test/pleroma/repo/migrations/fix_legacy_tags_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.FixLegacyTagsTest do diff --git a/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs b/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs index 65c9961b0..4c45adb4b 100644 --- a/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs +++ b/test/pleroma/repo/migrations/fix_malformed_formatter_config_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.FixMalformedFormatterConfigTest do diff --git a/test/pleroma/repo/migrations/move_welcome_settings_test.exs b/test/pleroma/repo/migrations/move_welcome_settings_test.exs index 1da6b8a04..3e485c3ad 100644 --- a/test/pleroma/repo/migrations/move_welcome_settings_test.exs +++ b/test/pleroma/repo/migrations/move_welcome_settings_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.MoveWelcomeSettingsTest do diff --git a/test/pleroma/repo/migrations/rename_instance_chat_test.exs b/test/pleroma/repo/migrations/rename_instance_chat_test.exs index acd45600c..17c39fd27 100644 --- a/test/pleroma/repo/migrations/rename_instance_chat_test.exs +++ b/test/pleroma/repo/migrations/rename_instance_chat_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Repo.Migrations.RenameInstanceChatTest do use Pleroma.DataCase import Pleroma.Factory diff --git a/test/pleroma/repo_test.exs b/test/pleroma/repo_test.exs index 9e14bdbd1..9c0f5d028 100644 --- a/test/pleroma/repo_test.exs +++ b/test/pleroma/repo_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.RepoTest do diff --git a/test/pleroma/report_note_test.exs b/test/pleroma/report_note_test.exs index 2620560a0..136ad9a40 100644 --- a/test/pleroma/report_note_test.exs +++ b/test/pleroma/report_note_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ReportNoteTest do diff --git a/test/pleroma/reverse_proxy_test.exs b/test/pleroma/reverse_proxy_test.exs index 49ddf251d..0bd4db8d1 100644 --- a/test/pleroma/reverse_proxy_test.exs +++ b/test/pleroma/reverse_proxy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ReverseProxyTest do diff --git a/test/pleroma/runtime_test.exs b/test/pleroma/runtime_test.exs index b9e769602..6b8d2050c 100644 --- a/test/pleroma/runtime_test.exs +++ b/test/pleroma/runtime_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.RuntimeTest do diff --git a/test/pleroma/safe_jsonb_set_test.exs b/test/pleroma/safe_jsonb_set_test.exs index 69d696c1b..ab1bba941 100644 --- a/test/pleroma/safe_jsonb_set_test.exs +++ b/test/pleroma/safe_jsonb_set_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.SafeJsonbSetTest do diff --git a/test/pleroma/scheduled_activity_test.exs b/test/pleroma/scheduled_activity_test.exs index ef91e9bce..3a0927d3f 100644 --- a/test/pleroma/scheduled_activity_test.exs +++ b/test/pleroma/scheduled_activity_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.ScheduledActivityTest do diff --git a/test/pleroma/signature_test.exs b/test/pleroma/signature_test.exs index 047c537e0..92d05f26c 100644 --- a/test/pleroma/signature_test.exs +++ b/test/pleroma/signature_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.SignatureTest do diff --git a/test/pleroma/stats_test.exs b/test/pleroma/stats_test.exs index fd3195969..37a085afc 100644 --- a/test/pleroma/stats_test.exs +++ b/test/pleroma/stats_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.StatsTest do diff --git a/test/pleroma/upload/filter/analyze_metadata_test.exs b/test/pleroma/upload/filter/analyze_metadata_test.exs index 4b636a684..b800a4a43 100644 --- a/test/pleroma/upload/filter/analyze_metadata_test.exs +++ b/test/pleroma/upload/filter/analyze_metadata_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do diff --git a/test/pleroma/upload/filter/anonymize_filename_test.exs b/test/pleroma/upload/filter/anonymize_filename_test.exs index 9387c1abc..9b94b91c3 100644 --- a/test/pleroma/upload/filter/anonymize_filename_test.exs +++ b/test/pleroma/upload/filter/anonymize_filename_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.AnonymizeFilenameTest do diff --git a/test/pleroma/upload/filter/dedupe_test.exs b/test/pleroma/upload/filter/dedupe_test.exs index f00ba12f9..29c181509 100644 --- a/test/pleroma/upload/filter/dedupe_test.exs +++ b/test/pleroma/upload/filter/dedupe_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.DedupeTest do diff --git a/test/pleroma/upload/filter/exiftool_test.exs b/test/pleroma/upload/filter/exiftool_test.exs index cfbe34be8..0a0ef2bdf 100644 --- a/test/pleroma/upload/filter/exiftool_test.exs +++ b/test/pleroma/upload/filter/exiftool_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.ExiftoolTest do diff --git a/test/pleroma/upload/filter/mogrifun_test.exs b/test/pleroma/upload/filter/mogrifun_test.exs index d2b183e90..bf9b65589 100644 --- a/test/pleroma/upload/filter/mogrifun_test.exs +++ b/test/pleroma/upload/filter/mogrifun_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.MogrifunTest do diff --git a/test/pleroma/upload/filter/mogrify_test.exs b/test/pleroma/upload/filter/mogrify_test.exs index d62cd83b4..208da57ca 100644 --- a/test/pleroma/upload/filter/mogrify_test.exs +++ b/test/pleroma/upload/filter/mogrify_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.Filter.MogrifyTest do diff --git a/test/pleroma/upload/filter_test.exs b/test/pleroma/upload/filter_test.exs index f0053ed9b..706fc9ac7 100644 --- a/test/pleroma/upload/filter_test.exs +++ b/test/pleroma/upload/filter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Upload.FilterTest do diff --git a/test/pleroma/upload_test.exs b/test/pleroma/upload_test.exs index f1ab82a57..f2795f985 100644 --- a/test/pleroma/upload_test.exs +++ b/test/pleroma/upload_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UploadTest do diff --git a/test/pleroma/uploaders/local_test.exs b/test/pleroma/uploaders/local_test.exs index 0a5952f50..a2b7f5c24 100644 --- a/test/pleroma/uploaders/local_test.exs +++ b/test/pleroma/uploaders/local_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Uploaders.LocalTest do diff --git a/test/pleroma/uploaders/s3_test.exs b/test/pleroma/uploaders/s3_test.exs index 2711e2c8d..d870449b1 100644 --- a/test/pleroma/uploaders/s3_test.exs +++ b/test/pleroma/uploaders/s3_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Uploaders.S3Test do diff --git a/test/pleroma/user/backup_test.exs b/test/pleroma/user/backup_test.exs index b16152876..6441c5ba8 100644 --- a/test/pleroma/user/backup_test.exs +++ b/test/pleroma/user/backup_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.BackupTest do diff --git a/test/pleroma/user/import_test.exs b/test/pleroma/user/import_test.exs index a84fce337..b4efd4bb0 100644 --- a/test/pleroma/user/import_test.exs +++ b/test/pleroma/user/import_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.ImportTest do diff --git a/test/pleroma/user/notification_setting_test.exs b/test/pleroma/user/notification_setting_test.exs index 6cb8803d9..da3c810f0 100644 --- a/test/pleroma/user/notification_setting_test.exs +++ b/test/pleroma/user/notification_setting_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.NotificationSettingTest do diff --git a/test/pleroma/user/query_test.exs b/test/pleroma/user/query_test.exs index 363da7665..bd45d1bca 100644 --- a/test/pleroma/user/query_test.exs +++ b/test/pleroma/user/query_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.QueryTest do diff --git a/test/pleroma/user/welcome_chat_message_test.exs b/test/pleroma/user/welcome_chat_message_test.exs index 42a45fa19..9f2cbdcc0 100644 --- a/test/pleroma/user/welcome_chat_message_test.exs +++ b/test/pleroma/user/welcome_chat_message_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.WelcomeChatMessageTest do diff --git a/test/pleroma/user/welcome_email_test.exs b/test/pleroma/user/welcome_email_test.exs index c3d383a7f..a7b932c7e 100644 --- a/test/pleroma/user/welcome_email_test.exs +++ b/test/pleroma/user/welcome_email_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.WelcomeEmailTest do diff --git a/test/pleroma/user/welcome_message_test.exs b/test/pleroma/user/welcome_message_test.exs index 28afde943..0d4fe1a8b 100644 --- a/test/pleroma/user/welcome_message_test.exs +++ b/test/pleroma/user/welcome_message_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.User.WelcomeMessageTest do diff --git a/test/pleroma/user_invite_token_test.exs b/test/pleroma/user_invite_token_test.exs index 233d4e864..3a384b3c0 100644 --- a/test/pleroma/user_invite_token_test.exs +++ b/test/pleroma/user_invite_token_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UserInviteTokenTest do diff --git a/test/pleroma/user_relationship_test.exs b/test/pleroma/user_relationship_test.exs index b2b074607..2811aff4c 100644 --- a/test/pleroma/user_relationship_test.exs +++ b/test/pleroma/user_relationship_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UserRelationshipTest do diff --git a/test/pleroma/user_search_test.exs b/test/pleroma/user_search_test.exs index 69167bb0c..9b94f421d 100644 --- a/test/pleroma/user_search_test.exs +++ b/test/pleroma/user_search_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UserSearchTest do diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index a9a3004a8..bb28a3f81 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UserTest do diff --git a/test/pleroma/utils_test.exs b/test/pleroma/utils_test.exs index c593a9490..cd225e82c 100644 --- a/test/pleroma/utils_test.exs +++ b/test/pleroma/utils_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.UtilsTest do diff --git a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs index 50315e21f..1923ec479 100644 --- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do diff --git a/test/pleroma/web/activity_pub/activity_pub_test.exs b/test/pleroma/web/activity_pub/activity_pub_test.exs index 9789d7704..8aa586f40 100644 --- a/test/pleroma/web/activity_pub/activity_pub_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ActivityPubTest do diff --git a/test/pleroma/web/activity_pub/builder_test.exs b/test/pleroma/web/activity_pub/builder_test.exs index 3fe32bce5..eb175a1be 100644 --- a/test/pleroma/web/activity_pub/builder_test.exs +++ b/test/pleroma/web/activity_pub/builder_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.BuilderTest do diff --git a/test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs b/test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs index 47b07fdd9..817eba3f5 100644 --- a/test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/activity_expiration_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs b/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs index d5af3a9b6..8192629c6 100644 --- a/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs b/test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs index 5b990451c..8c7d4de5c 100644 --- a/test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/anti_link_spam_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs b/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs index 89439b65f..bc2f09e29 100644 --- a/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs +++ b/test/pleroma/web/activity_pub/mrf/ensure_re_prepended_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.EnsureRePrependedTest do diff --git a/test/pleroma/web/activity_pub/mrf/follow_bot_policy_test.exs b/test/pleroma/web/activity_pub/mrf/follow_bot_policy_test.exs index a61562558..248190034 100644 --- a/test/pleroma/web/activity_pub/mrf/follow_bot_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/follow_bot_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.FollowBotPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs b/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs index e3325d144..d1e900164 100644 --- a/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_bot_unlisted_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs index 669ec5251..125b14a59 100644 --- a/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs +++ b/test/pleroma/web/activity_pub/mrf/force_mentions_in_content_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ForceMentionsInContentTest do diff --git a/test/pleroma/web/activity_pub/mrf/hashtag_policy_test.exs b/test/pleroma/web/activity_pub/mrf/hashtag_policy_test.exs index 13415bb79..7f2d78a4c 100644 --- a/test/pleroma/web/activity_pub/mrf/hashtag_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/hashtag_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.HashtagPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs b/test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs index 439672479..3ab723052 100644 --- a/test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/hellthread_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs b/test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs index 8af4c5efa..bfa8e8f59 100644 --- a/test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/keyword_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs b/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs index 96e715d0d..09301c6ca 100644 --- a/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/media_proxy_warming_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/mention_policy_test.exs b/test/pleroma/web/activity_pub/mrf/mention_policy_test.exs index 80ddcacbe..6dcae44a0 100644 --- a/test/pleroma/web/activity_pub/mrf/mention_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/mention_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs b/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs index fbcf68414..fe4bb8f0a 100644 --- a/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/no_empty_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.NoEmptyPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs b/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs index 81a6e0f50..acc7c3566 100644 --- a/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/no_placeholder_text_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs b/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs index edc330b6c..20176b63b 100644 --- a/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs +++ b/test/pleroma/web/activity_pub/mrf/normalize_markup_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do diff --git a/test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs b/test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs index 2f649a0a4..7a67645aa 100644 --- a/test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/object_age_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.ObjectAgePolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs b/test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs index 63c68d798..0ad60a3b0 100644 --- a/test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs +++ b/test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublicTest do diff --git a/test/pleroma/web/activity_pub/mrf/simple_policy_test.exs b/test/pleroma/web/activity_pub/mrf/simple_policy_test.exs index 0a0f51bdb..674b506c3 100644 --- a/test/pleroma/web/activity_pub/mrf/simple_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/simple_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs b/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs index 1b37e4c26..c537670f2 100644 --- a/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs b/test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs index 4f5cc466c..8cbeef9e9 100644 --- a/test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/subchain_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.SubchainPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs b/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs index faaadff79..46be316ee 100644 --- a/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/tag_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs b/test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs index f0432ea42..d02af3bd0 100644 --- a/test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/user_allow_list_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.UserAllowListPolicyTest do use Pleroma.DataCase diff --git a/test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs b/test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs index 87d1d79b5..68c18cfe1 100644 --- a/test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/vocabulary_policy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRF.VocabularyPolicyTest do diff --git a/test/pleroma/web/activity_pub/mrf_test.exs b/test/pleroma/web/activity_pub/mrf_test.exs index 6ab27bc86..8d14e976a 100644 --- a/test/pleroma/web/activity_pub/mrf_test.exs +++ b/test/pleroma/web/activity_pub/mrf_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.MRFTest do diff --git a/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs index ddb302f6e..70d851948 100644 --- a/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/accept_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AcceptValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs index 20964e855..5b2fcb26d 100644 --- a/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/announce_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AnnounceValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs index 150b26bea..f93537ed8 100644 --- a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest do diff --git a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs index 9150b8d41..b07011b76 100644 --- a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do diff --git a/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs index ad6190892..24e8864f7 100644 --- a/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/block_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.BlockValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs index def2a10b4..8192efe97 100644 --- a/test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/chat_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs index c3e6854e4..0a5b44beb 100644 --- a/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/create_generic_validator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateGenericValidatorTest do diff --git a/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs index 7ae4399ed..ea4664859 100644 --- a/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/delete_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.DeleteValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs index 7fd98266a..bbdb09c4c 100644 --- a/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/emoji_react_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactHandlingTest do diff --git a/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs index d2a9b72a5..371368e0e 100644 --- a/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/follow_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.FollowValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs index e9ad817f1..ebc181a6d 100644 --- a/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/like_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.LikeValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs b/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs index 562656a5f..7afab4247 100644 --- a/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/reject_validation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.RejectValidationTest do diff --git a/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs index 505ca2d2f..db95b8e3c 100644 --- a/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/undo_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.UndoHandlingTest do diff --git a/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs b/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs index 15e4a82cd..94bc5a89b 100644 --- a/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/update_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectValidators.UpdateHandlingTest do diff --git a/test/pleroma/web/activity_pub/pipeline_test.exs b/test/pleroma/web/activity_pub/pipeline_test.exs index e606fa3d1..5b65d1014 100644 --- a/test/pleroma/web/activity_pub/pipeline_test.exs +++ b/test/pleroma/web/activity_pub/pipeline_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.PipelineTest do diff --git a/test/pleroma/web/activity_pub/publisher_test.exs b/test/pleroma/web/activity_pub/publisher_test.exs index b50e22bbe..e2db3d575 100644 --- a/test/pleroma/web/activity_pub/publisher_test.exs +++ b/test/pleroma/web/activity_pub/publisher_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.PublisherTest do diff --git a/test/pleroma/web/activity_pub/relay_test.exs b/test/pleroma/web/activity_pub/relay_test.exs index d6de7d61e..ec9b0f09a 100644 --- a/test/pleroma/web/activity_pub/relay_test.exs +++ b/test/pleroma/web/activity_pub/relay_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.RelayTest do diff --git a/test/pleroma/web/activity_pub/side_effects/delete_test.exs b/test/pleroma/web/activity_pub/side_effects/delete_test.exs index 20f0d4b70..9a2703c4c 100644 --- a/test/pleroma/web/activity_pub/side_effects/delete_test.exs +++ b/test/pleroma/web/activity_pub/side_effects/delete_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.SideEffects.DeleteTest do diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index c6155ed18..64c4a8c14 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.SideEffectsTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs index 58490076d..968fd4ede 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/accept_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.AcceptHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/add_remove_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/add_remove_handling_test.exs index b17c0e7bf..a8a7edca5 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/add_remove_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/add_remove_handling_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.ActivityPub.Transmogrifier.AddRemoveHandlingTest do use Oban.Testing, repo: Pleroma.Repo use Pleroma.DataCase, async: true diff --git a/test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs index 524acddaf..9521cc0ab 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnnounceHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs index 9c2ef547b..39a1598a8 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/answer_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnswerHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/article_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/article_handling_test.exs index 5dbc5eb95..252492013 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/article_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/article_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.ArticleHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs index a0942ce8b..d1eb21a0c 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/audio_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.AudioHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs index 70da06d2e..c9a20b1ae 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/block_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.BlockHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs b/test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs index 958675835..c798a0fc9 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/chat_message_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.ChatMessageTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs index b7160bf58..4a7ff5158 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/delete_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.DeleteHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index 20424ee82..ceedb185f 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs index 14f5f704a..6372aa89a 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/event_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.EventHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs index 604444a4c..3c07926e6 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/follow_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs index 57d74349a..c02f66d77 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/like_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.LikeHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs index 1846b2291..b00fd919b 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/page_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/page_handling_test.exs index 4ac71e066..d50c7f4ef 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/page_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/page_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.PageHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs index 32cf51e59..d22ec400d 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/question_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.QuestionHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs index 355e664d4..11562422d 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/reject_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.RejectHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs index f6e40722c..846d25cbe 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/undo_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.UndoHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs index b1a064772..da46f063a 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/user_update_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.UserUpdateHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs index 87c53ebf4..57b517100 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/video_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.VideoHandlingTest do diff --git a/test/pleroma/web/activity_pub/transmogrifier_test.exs b/test/pleroma/web/activity_pub/transmogrifier_test.exs index 41a30be0b..335fe1a30 100644 --- a/test/pleroma/web/activity_pub/transmogrifier_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do diff --git a/test/pleroma/web/activity_pub/utils_test.exs b/test/pleroma/web/activity_pub/utils_test.exs index 62dc02f61..447621718 100644 --- a/test/pleroma/web/activity_pub/utils_test.exs +++ b/test/pleroma/web/activity_pub/utils_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.UtilsTest do diff --git a/test/pleroma/web/activity_pub/views/object_view_test.exs b/test/pleroma/web/activity_pub/views/object_view_test.exs index 923515dec..48a4b47c4 100644 --- a/test/pleroma/web/activity_pub/views/object_view_test.exs +++ b/test/pleroma/web/activity_pub/views/object_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.ObjectViewTest do diff --git a/test/pleroma/web/activity_pub/views/user_view_test.exs b/test/pleroma/web/activity_pub/views/user_view_test.exs index f2de4d332..5cbfd8ab7 100644 --- a/test/pleroma/web/activity_pub/views/user_view_test.exs +++ b/test/pleroma/web/activity_pub/views/user_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.UserViewTest do diff --git a/test/pleroma/web/activity_pub/visibility_test.exs b/test/pleroma/web/activity_pub/visibility_test.exs index 23485225d..8c4c06a95 100644 --- a/test/pleroma/web/activity_pub/visibility_test.exs +++ b/test/pleroma/web/activity_pub/visibility_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.VisibilityTest do diff --git a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs index f8cd103c6..d83f7f011 100644 --- a/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/chat_controller_test.exs b/test/pleroma/web/admin_api/controllers/chat_controller_test.exs index 0e8f7beef..ccf25a244 100644 --- a/test/pleroma/web/admin_api/controllers/chat_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/chat_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ChatControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/config_controller_test.exs b/test/pleroma/web/admin_api/controllers/config_controller_test.exs index 7c786c389..6d014b65b 100644 --- a/test/pleroma/web/admin_api/controllers/config_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/config_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs b/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs index 200682ba9..38a23b224 100644 --- a/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/instance_controller_test.exs b/test/pleroma/web/admin_api/controllers/instance_controller_test.exs index c78307fc8..72436cd83 100644 --- a/test/pleroma/web/admin_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/instance_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.InstanceControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/instance_document_controller_test.exs b/test/pleroma/web/admin_api/controllers/instance_document_controller_test.exs index e100f6929..2601a026f 100644 --- a/test/pleroma/web/admin_api/controllers/instance_document_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/instance_document_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.InstanceDocumentControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/invite_controller_test.exs b/test/pleroma/web/admin_api/controllers/invite_controller_test.exs index 6366061c8..b9d48a4b6 100644 --- a/test/pleroma/web/admin_api/controllers/invite_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/invite_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.InviteControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs b/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs index 1818c8a8e..852334a57 100644 --- a/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/media_proxy_cache_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs b/test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs index d9b25719a..80646dd25 100644 --- a/test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/o_auth_app_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.OAuthAppControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/relay_controller_test.exs b/test/pleroma/web/admin_api/controllers/relay_controller_test.exs index 11a480cc0..1da0fcd65 100644 --- a/test/pleroma/web/admin_api/controllers/relay_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/relay_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.RelayControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs index 802a8c05f..6211956c6 100644 --- a/test/pleroma/web/admin_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ReportControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/status_controller_test.exs b/test/pleroma/web/admin_api/controllers/status_controller_test.exs index 3fdf23ba2..8bb96ca87 100644 --- a/test/pleroma/web/admin_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/status_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.StatusControllerTest do diff --git a/test/pleroma/web/admin_api/controllers/user_controller_test.exs b/test/pleroma/web/admin_api/controllers/user_controller_test.exs index b199fa704..79971be06 100644 --- a/test/pleroma/web/admin_api/controllers/user_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/user_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.UserControllerTest do diff --git a/test/pleroma/web/admin_api/search_test.exs b/test/pleroma/web/admin_api/search_test.exs index 2335c5228..e19316775 100644 --- a/test/pleroma/web/admin_api/search_test.exs +++ b/test/pleroma/web/admin_api/search_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.SearchTest do diff --git a/test/pleroma/web/admin_api/views/account_view_test.exs b/test/pleroma/web/admin_api/views/account_view_test.exs index 025726c73..aecaf086c 100644 --- a/test/pleroma/web/admin_api/views/account_view_test.exs +++ b/test/pleroma/web/admin_api/views/account_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.AccountViewTest do diff --git a/test/pleroma/web/admin_api/views/moderation_log_view_test.exs b/test/pleroma/web/admin_api/views/moderation_log_view_test.exs index 4efe4c4c8..3a317da35 100644 --- a/test/pleroma/web/admin_api/views/moderation_log_view_test.exs +++ b/test/pleroma/web/admin_api/views/moderation_log_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ModerationLogViewTest do use Pleroma.DataCase, async: true diff --git a/test/pleroma/web/admin_api/views/report_view_test.exs b/test/pleroma/web/admin_api/views/report_view_test.exs index 093e2d95d..9637c2b90 100644 --- a/test/pleroma/web/admin_api/views/report_view_test.exs +++ b/test/pleroma/web/admin_api/views/report_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.AdminAPI.ReportViewTest do diff --git a/test/pleroma/web/api_spec/schema_examples_test.exs b/test/pleroma/web/api_spec/schema_examples_test.exs index 981890d77..0938d867f 100644 --- a/test/pleroma/web/api_spec/schema_examples_test.exs +++ b/test/pleroma/web/api_spec/schema_examples_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ApiSpec.SchemaExamplesTest do diff --git a/test/pleroma/web/auth/auth_controller_test.exs b/test/pleroma/web/auth/auth_controller_test.exs index a869389e3..cb6d71006 100644 --- a/test/pleroma/web/auth/auth_controller_test.exs +++ b/test/pleroma/web/auth/auth_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.AuthControllerTest do diff --git a/test/pleroma/web/auth/authenticator_test.exs b/test/pleroma/web/auth/authenticator_test.exs index 26779df03..bac796cd2 100644 --- a/test/pleroma/web/auth/authenticator_test.exs +++ b/test/pleroma/web/auth/authenticator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.AuthenticatorTest do diff --git a/test/pleroma/web/auth/basic_auth_test.exs b/test/pleroma/web/auth/basic_auth_test.exs index 2816aae4c..9d9fdfd16 100644 --- a/test/pleroma/web/auth/basic_auth_test.exs +++ b/test/pleroma/web/auth/basic_auth_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.BasicAuthTest do diff --git a/test/pleroma/web/auth/pleroma_authenticator_test.exs b/test/pleroma/web/auth/pleroma_authenticator_test.exs index b1397c523..7f6d63ff3 100644 --- a/test/pleroma/web/auth/pleroma_authenticator_test.exs +++ b/test/pleroma/web/auth/pleroma_authenticator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.PleromaAuthenticatorTest do diff --git a/test/pleroma/web/auth/totp_authenticator_test.exs b/test/pleroma/web/auth/totp_authenticator_test.exs index ac4209f2d..09a157c51 100644 --- a/test/pleroma/web/auth/totp_authenticator_test.exs +++ b/test/pleroma/web/auth/totp_authenticator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Auth.TOTPAuthenticatorTest do diff --git a/test/pleroma/web/common_api/utils_test.exs b/test/pleroma/web/common_api/utils_test.exs index 7063b2503..5b2019969 100644 --- a/test/pleroma/web/common_api/utils_test.exs +++ b/test/pleroma/web/common_api/utils_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.CommonAPI.UtilsTest do diff --git a/test/pleroma/web/common_api_test.exs b/test/pleroma/web/common_api_test.exs index 16af4b923..b502aaa03 100644 --- a/test/pleroma/web/common_api_test.exs +++ b/test/pleroma/web/common_api_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.CommonAPITest do diff --git a/test/pleroma/web/endpoint/metrics_exporter_test.exs b/test/pleroma/web/endpoint/metrics_exporter_test.exs index 376e82149..ad236d4cb 100644 --- a/test/pleroma/web/endpoint/metrics_exporter_test.exs +++ b/test/pleroma/web/endpoint/metrics_exporter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Endpoint.MetricsExporterTest do diff --git a/test/pleroma/web/fallback_test.exs b/test/pleroma/web/fallback_test.exs index 512baf813..6d11d4f37 100644 --- a/test/pleroma/web/fallback_test.exs +++ b/test/pleroma/web/fallback_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.FallbackTest do diff --git a/test/pleroma/web/federator_test.exs b/test/pleroma/web/federator_test.exs index 372b6a73a..5120bf57c 100644 --- a/test/pleroma/web/federator_test.exs +++ b/test/pleroma/web/federator_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.FederatorTest do diff --git a/test/pleroma/web/feed/tag_controller_test.exs b/test/pleroma/web/feed/tag_controller_test.exs index 140cdb8bf..1bd2b157c 100644 --- a/test/pleroma/web/feed/tag_controller_test.exs +++ b/test/pleroma/web/feed/tag_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Feed.TagControllerTest do diff --git a/test/pleroma/web/feed/user_controller_test.exs b/test/pleroma/web/feed/user_controller_test.exs index 6e3f790b2..38cde3315 100644 --- a/test/pleroma/web/feed/user_controller_test.exs +++ b/test/pleroma/web/feed/user_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Feed.UserControllerTest do diff --git a/test/pleroma/web/manifest_controller_test.exs b/test/pleroma/web/manifest_controller_test.exs index b7a4940db..f442708a8 100644 --- a/test/pleroma/web/manifest_controller_test.exs +++ b/test/pleroma/web/manifest_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ManifestControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index f272ed1ae..853d2c111 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs index bfbb7f32d..bc9d4048c 100644 --- a/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/app_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.AppControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs index 00797a9ea..ae9a6dd63 100644 --- a/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/conversation_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/custom_emoji_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/custom_emoji_controller_test.exs index cbb1d54a6..bcd3f61d9 100644 --- a/test/pleroma/web/mastodon_api/controllers/custom_emoji_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/custom_emoji_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.CustomEmojiControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/directory_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/directory_controller_test.exs index b8f55f832..f90ef96f9 100644 --- a/test/pleroma/web/mastodon_api/controllers/directory_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/directory_controller_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.MastodonAPI.DirectoryControllerTest do use Pleroma.Web.ConnCase, async: true alias Pleroma.Web.CommonAPI diff --git a/test/pleroma/web/mastodon_api/controllers/domain_block_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/domain_block_controller_test.exs index 0c3a7c0cf..2c22108f8 100644 --- a/test/pleroma/web/mastodon_api/controllers/domain_block_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/domain_block_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.DomainBlockControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs index d8fc2400b..ba4628fc5 100644 --- a/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/filter_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.FilterControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs index 069ffb3d6..ff01b549c 100644 --- a/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/follow_request_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.FollowRequestControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs index e76cbc75b..9845408d6 100644 --- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs index 28099837e..430b8b89d 100644 --- a/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/list_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ListControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs index 53aebe8e4..d8f7b2638 100644 --- a/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/marker_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MarkerControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/media_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/media_controller_test.exs index ff988a7fd..79d52bb2f 100644 --- a/test/pleroma/web/mastodon_api/controllers/media_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/media_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MediaControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs index d991f284f..2b7a95635 100644 --- a/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs index da0a631a9..7912b1d5f 100644 --- a/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/poll_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.PollControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs index fcfc4a48a..6d1a63334 100644 --- a/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/report_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ReportControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/scheduled_activity_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/scheduled_activity_controller_test.exs index b28e3df56..21f2ea6f5 100644 --- a/test/pleroma/web/mastodon_api/controllers/scheduled_activity_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/scheduled_activity_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ScheduledActivityControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs index e31cd0291..8753c7716 100644 --- a/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/search_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs index ed66d370a..dc6912b7b 100644 --- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs index 5a3f93d2d..ce7cfa9c7 100644 --- a/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/subscription_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs index 89273e67b..c0f3d5a2a 100644 --- a/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/suggestion_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do diff --git a/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs index 187982d92..2c7e78595 100644 --- a/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/timeline_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do diff --git a/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs b/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs index c6332bd3e..622c5e3d5 100644 --- a/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/pleroma/web/mastodon_api/mastodon_api_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do diff --git a/test/pleroma/web/mastodon_api/mastodon_api_test.exs b/test/pleroma/web/mastodon_api/mastodon_api_test.exs index 402bfd76f..250a20352 100644 --- a/test/pleroma/web/mastodon_api/mastodon_api_test.exs +++ b/test/pleroma/web/mastodon_api/mastodon_api_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MastodonAPITest do diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index f0618885a..c2e4debc8 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 9fc56f7f0..8ed37fe58 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.AccountViewTest do diff --git a/test/pleroma/web/mastodon_api/views/conversation_view_test.exs b/test/pleroma/web/mastodon_api/views/conversation_view_test.exs index 9639e95d2..d9529c346 100644 --- a/test/pleroma/web/mastodon_api/views/conversation_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/conversation_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ConversationViewTest do diff --git a/test/pleroma/web/mastodon_api/views/list_view_test.exs b/test/pleroma/web/mastodon_api/views/list_view_test.exs index a62495ebb..bbf87bab2 100644 --- a/test/pleroma/web/mastodon_api/views/list_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/list_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ListViewTest do diff --git a/test/pleroma/web/mastodon_api/views/marker_view_test.exs b/test/pleroma/web/mastodon_api/views/marker_view_test.exs index 8d8c16f6c..43f8c4302 100644 --- a/test/pleroma/web/mastodon_api/views/marker_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/marker_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.MarkerViewTest do diff --git a/test/pleroma/web/mastodon_api/views/notification_view_test.exs b/test/pleroma/web/mastodon_api/views/notification_view_test.exs index 8070c03c9..8e4c9136a 100644 --- a/test/pleroma/web/mastodon_api/views/notification_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/notification_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do diff --git a/test/pleroma/web/mastodon_api/views/poll_view_test.exs b/test/pleroma/web/mastodon_api/views/poll_view_test.exs index 224b26cb9..a73d862fd 100644 --- a/test/pleroma/web/mastodon_api/views/poll_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/poll_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.PollViewTest do diff --git a/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs b/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs index e323f3a1f..e5e510d33 100644 --- a/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/scheduled_activity_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.ScheduledActivityViewTest do diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs index 9dfdf8bf0..5d81c92b9 100644 --- a/test/pleroma/web/mastodon_api/views/status_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.StatusViewTest do diff --git a/test/pleroma/web/mastodon_api/views/subscription_view_test.exs b/test/pleroma/web/mastodon_api/views/subscription_view_test.exs index 04b440389..fd4cd962a 100644 --- a/test/pleroma/web/mastodon_api/views/subscription_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/subscription_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SubscriptionViewTest do diff --git a/test/pleroma/web/mastodon_api/views/suggestion_view_test.exs b/test/pleroma/web/mastodon_api/views/suggestion_view_test.exs index 5aae36ce9..b0db41047 100644 --- a/test/pleroma/web/mastodon_api/views/suggestion_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/suggestion_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.SuggestionViewTest do diff --git a/test/pleroma/web/media_proxy/invalidation/http_test.exs b/test/pleroma/web/media_proxy/invalidation/http_test.exs index a15103c89..b920242fd 100644 --- a/test/pleroma/web/media_proxy/invalidation/http_test.exs +++ b/test/pleroma/web/media_proxy/invalidation/http_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do diff --git a/test/pleroma/web/media_proxy/invalidation/script_test.exs b/test/pleroma/web/media_proxy/invalidation/script_test.exs index e9629b72b..39ef365f4 100644 --- a/test/pleroma/web/media_proxy/invalidation/script_test.exs +++ b/test/pleroma/web/media_proxy/invalidation/script_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do diff --git a/test/pleroma/web/media_proxy/invalidation_test.exs b/test/pleroma/web/media_proxy/invalidation_test.exs index c77b8c94a..6196c69be 100644 --- a/test/pleroma/web/media_proxy/invalidation_test.exs +++ b/test/pleroma/web/media_proxy/invalidation_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxy.InvalidationTest do diff --git a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs index 1f2e54194..5ace2eee9 100644 --- a/test/pleroma/web/media_proxy/media_proxy_controller_test.exs +++ b/test/pleroma/web/media_proxy/media_proxy_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do diff --git a/test/pleroma/web/media_proxy_test.exs b/test/pleroma/web/media_proxy_test.exs index d97874f3a..ffab1247f 100644 --- a/test/pleroma/web/media_proxy_test.exs +++ b/test/pleroma/web/media_proxy_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MediaProxyTest do diff --git a/test/pleroma/web/metadata/player_view_test.exs b/test/pleroma/web/metadata/player_view_test.exs index 58caf6efd..7daa2f693 100644 --- a/test/pleroma/web/metadata/player_view_test.exs +++ b/test/pleroma/web/metadata/player_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.PlayerViewTest do diff --git a/test/pleroma/web/metadata/providers/feed_test.exs b/test/pleroma/web/metadata/providers/feed_test.exs index 013d42498..e593453da 100644 --- a/test/pleroma/web/metadata/providers/feed_test.exs +++ b/test/pleroma/web/metadata/providers/feed_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.FeedTest do diff --git a/test/pleroma/web/metadata/providers/open_graph_test.exs b/test/pleroma/web/metadata/providers/open_graph_test.exs index 28ca8839c..b7ce95f7d 100644 --- a/test/pleroma/web/metadata/providers/open_graph_test.exs +++ b/test/pleroma/web/metadata/providers/open_graph_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.OpenGraphTest do diff --git a/test/pleroma/web/metadata/providers/rel_me_test.exs b/test/pleroma/web/metadata/providers/rel_me_test.exs index 0db6e7d22..cce4f3607 100644 --- a/test/pleroma/web/metadata/providers/rel_me_test.exs +++ b/test/pleroma/web/metadata/providers/rel_me_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.RelMeTest do diff --git a/test/pleroma/web/metadata/providers/restrict_indexing_test.exs b/test/pleroma/web/metadata/providers/restrict_indexing_test.exs index aa253e5e2..70aa5f462 100644 --- a/test/pleroma/web/metadata/providers/restrict_indexing_test.exs +++ b/test/pleroma/web/metadata/providers/restrict_indexing_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.RestrictIndexingTest do diff --git a/test/pleroma/web/metadata/providers/twitter_card_test.exs b/test/pleroma/web/metadata/providers/twitter_card_test.exs index 1b8d27cda..392496993 100644 --- a/test/pleroma/web/metadata/providers/twitter_card_test.exs +++ b/test/pleroma/web/metadata/providers/twitter_card_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.Providers.TwitterCardTest do diff --git a/test/pleroma/web/metadata/utils_test.exs b/test/pleroma/web/metadata/utils_test.exs index 074bd2e2f..ce8ed5683 100644 --- a/test/pleroma/web/metadata/utils_test.exs +++ b/test/pleroma/web/metadata/utils_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Metadata.UtilsTest do diff --git a/test/pleroma/web/mongoose_im_controller_test.exs b/test/pleroma/web/mongoose_im_controller_test.exs index 43c4dfa33..46726fb62 100644 --- a/test/pleroma/web/mongoose_im_controller_test.exs +++ b/test/pleroma/web/mongoose_im_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MongooseIMControllerTest do diff --git a/test/pleroma/web/node_info_test.exs b/test/pleroma/web/node_info_test.exs index 9deceb1b5..247ad7501 100644 --- a/test/pleroma/web/node_info_test.exs +++ b/test/pleroma/web/node_info_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.NodeInfoTest do diff --git a/test/pleroma/web/o_auth/app_test.exs b/test/pleroma/web/o_auth/app_test.exs index a5223b0a5..7bbbb26d0 100644 --- a/test/pleroma/web/o_auth/app_test.exs +++ b/test/pleroma/web/o_auth/app_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.AppTest do diff --git a/test/pleroma/web/o_auth/authorization_test.exs b/test/pleroma/web/o_auth/authorization_test.exs index fc1c04c4c..a44265615 100644 --- a/test/pleroma/web/o_auth/authorization_test.exs +++ b/test/pleroma/web/o_auth/authorization_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.AuthorizationTest do diff --git a/test/pleroma/web/o_auth/ldap_authorization_test.exs b/test/pleroma/web/o_auth/ldap_authorization_test.exs index 61b9ce6b7..5ab8236b5 100644 --- a/test/pleroma/web/o_auth/ldap_authorization_test.exs +++ b/test/pleroma/web/o_auth/ldap_authorization_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do diff --git a/test/pleroma/web/o_auth/mfa_controller_test.exs b/test/pleroma/web/o_auth/mfa_controller_test.exs index 17bbde85b..62404c768 100644 --- a/test/pleroma/web/o_auth/mfa_controller_test.exs +++ b/test/pleroma/web/o_auth/mfa_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.MFAControllerTest do diff --git a/test/pleroma/web/o_auth/o_auth_controller_test.exs b/test/pleroma/web/o_auth/o_auth_controller_test.exs index 0fdd5b8e9..f41d6a322 100644 --- a/test/pleroma/web/o_auth/o_auth_controller_test.exs +++ b/test/pleroma/web/o_auth/o_auth_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.OAuthControllerTest do diff --git a/test/pleroma/web/o_auth/token/utils_test.exs b/test/pleroma/web/o_auth/token/utils_test.exs index d2e7a0904..e688ad750 100644 --- a/test/pleroma/web/o_auth/token/utils_test.exs +++ b/test/pleroma/web/o_auth/token/utils_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.Token.UtilsTest do diff --git a/test/pleroma/web/o_auth/token_test.exs b/test/pleroma/web/o_auth/token_test.exs index 8c0858ebc..5a6ab85be 100644 --- a/test/pleroma/web/o_auth/token_test.exs +++ b/test/pleroma/web/o_auth/token_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OAuth.TokenTest do diff --git a/test/pleroma/web/o_status/o_status_controller_test.exs b/test/pleroma/web/o_status/o_status_controller_test.exs index 41aef98b1..5abbcfbdc 100644 --- a/test/pleroma/web/o_status/o_status_controller_test.exs +++ b/test/pleroma/web/o_status/o_status_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.OStatus.OStatusControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs index 15682e40a..8f000760f 100644 --- a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs index 5e24e18a8..f630875d5 100644 --- a/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/app_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.AppControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs index 3ee660a05..650f3d80d 100644 --- a/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/backup_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.BackupControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs index 99b0d43a7..aa40c6f44 100644 --- a/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/chat_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do use Pleroma.Web.ConnCase diff --git a/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs index 54f2c5a58..c8dd74b03 100644 --- a/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/conversation_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ConversationControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs index 547391249..200ce3b68 100644 --- a/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/emoji_file_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.EmojiFileControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs index d1ba067b8..d1fd1cbb0 100644 --- a/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/emoji_reaction_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/emoji_reaction_controller_test.exs index 28483985c..77c75b560 100644 --- a/test/pleroma/web/pleroma_api/controllers/emoji_reaction_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/emoji_reaction_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.EmojiReactionControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs index 54cf9d083..365d26ab1 100644 --- a/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/instances_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaApi.InstancesControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs index 0011ddd54..b72569d4b 100644 --- a/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs index 08f374908..b8c7964f9 100644 --- a/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/notification_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/report_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/report_controller_test.exs index c507aeca0..7940564b7 100644 --- a/test/pleroma/web/pleroma_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/report_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ReportControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs index d4546f442..908ce962d 100644 --- a/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/scrobble_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ScrobbleControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs index 24074f4e5..aa44cf473 100644 --- a/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.TwoFactorAuthenticationControllerTest do diff --git a/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs index d977bc3a2..52a62e416 100644 --- a/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs +++ b/test/pleroma/web/pleroma_api/controllers/user_import_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.UserImportControllerTest do diff --git a/test/pleroma/web/pleroma_api/views/app_view_test.exs b/test/pleroma/web/pleroma_api/views/app_view_test.exs index f0aee6987..255b8e549 100644 --- a/test/pleroma/web/pleroma_api/views/app_view_test.exs +++ b/test/pleroma/web/pleroma_api/views/app_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.AppViewTest do diff --git a/test/pleroma/web/pleroma_api/views/backup_view_test.exs b/test/pleroma/web/pleroma_api/views/backup_view_test.exs index 9b4298dd1..a86688bc4 100644 --- a/test/pleroma/web/pleroma_api/views/backup_view_test.exs +++ b/test/pleroma/web/pleroma_api/views/backup_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.BackupViewTest do diff --git a/test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs b/test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs index 6deaa2102..017c9c5c0 100644 --- a/test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs +++ b/test/pleroma/web/pleroma_api/views/chat_message_reference_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ChatMessageReferenceViewTest do diff --git a/test/pleroma/web/pleroma_api/views/chat_view_test.exs b/test/pleroma/web/pleroma_api/views/chat_view_test.exs index 5456c2de0..405f1b6b7 100644 --- a/test/pleroma/web/pleroma_api/views/chat_view_test.exs +++ b/test/pleroma/web/pleroma_api/views/chat_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ChatViewTest do diff --git a/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs b/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs index 382051f6f..7d547ec3a 100644 --- a/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs +++ b/test/pleroma/web/pleroma_api/views/scrobble_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.PleromaAPI.ScrobbleViewTest do diff --git a/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs b/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs index 79561afb7..8337969fe 100644 --- a/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs +++ b/test/pleroma/web/plugs/admin_secret_authentication_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.AdminSecretAuthenticationPlugTest do diff --git a/test/pleroma/web/plugs/authentication_plug_test.exs b/test/pleroma/web/plugs/authentication_plug_test.exs index 118ab302a..41fdb93bc 100644 --- a/test/pleroma/web/plugs/authentication_plug_test.exs +++ b/test/pleroma/web/plugs/authentication_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.AuthenticationPlugTest do diff --git a/test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs b/test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs index e90078eb5..099216734 100644 --- a/test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs +++ b/test/pleroma/web/plugs/basic_auth_decoder_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.BasicAuthDecoderPlugTest do diff --git a/test/pleroma/web/plugs/cache_control_test.exs b/test/pleroma/web/plugs/cache_control_test.exs index 263961897..b41472dc8 100644 --- a/test/pleroma/web/plugs/cache_control_test.exs +++ b/test/pleroma/web/plugs/cache_control_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.CacheControlTest do diff --git a/test/pleroma/web/plugs/cache_test.exs b/test/pleroma/web/plugs/cache_test.exs index 0ceab6cab..d84e2d268 100644 --- a/test/pleroma/web/plugs/cache_test.exs +++ b/test/pleroma/web/plugs/cache_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.CacheTest do diff --git a/test/pleroma/web/plugs/digest_plug_test.exs b/test/pleroma/web/plugs/digest_plug_test.exs index 629c28c93..19f8a6f49 100644 --- a/test/pleroma/web/plugs/digest_plug_test.exs +++ b/test/pleroma/web/plugs/digest_plug_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Web.Plugs.DigestPlugTest do use ExUnit.Case, async: true use Plug.Test diff --git a/test/pleroma/web/plugs/ensure_authenticated_plug_test.exs b/test/pleroma/web/plugs/ensure_authenticated_plug_test.exs index 6b3ee3d87..da6b29f0b 100644 --- a/test/pleroma/web/plugs/ensure_authenticated_plug_test.exs +++ b/test/pleroma/web/plugs/ensure_authenticated_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.EnsureAuthenticatedPlugTest do diff --git a/test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs b/test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs index 75c3b5784..35edaa825 100644 --- a/test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs +++ b/test/pleroma/web/plugs/ensure_public_or_authenticated_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlugTest do diff --git a/test/pleroma/web/plugs/ensure_staff_privileged_plug_test.exs b/test/pleroma/web/plugs/ensure_staff_privileged_plug_test.exs index 74f4ae504..c684714b8 100644 --- a/test/pleroma/web/plugs/ensure_staff_privileged_plug_test.exs +++ b/test/pleroma/web/plugs/ensure_staff_privileged_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.EnsureStaffPrivilegedPlugTest do diff --git a/test/pleroma/web/plugs/ensure_user_token_assigns_plug_test.exs b/test/pleroma/web/plugs/ensure_user_token_assigns_plug_test.exs index 28ec67158..f98ed0f2e 100644 --- a/test/pleroma/web/plugs/ensure_user_token_assigns_plug_test.exs +++ b/test/pleroma/web/plugs/ensure_user_token_assigns_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.EnsureUserTokenAssignsPlugTest do diff --git a/test/pleroma/web/plugs/federating_plug_test.exs b/test/pleroma/web/plugs/federating_plug_test.exs index 01ecd2a1e..627749c18 100644 --- a/test/pleroma/web/plugs/federating_plug_test.exs +++ b/test/pleroma/web/plugs/federating_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.FederatingPlugTest do diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index 4b3925ad2..a91e24c49 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do diff --git a/test/pleroma/web/plugs/http_security_plug_test.exs b/test/pleroma/web/plugs/http_security_plug_test.exs index 4e7befdd5..e1e97c1ce 100644 --- a/test/pleroma/web/plugs/http_security_plug_test.exs +++ b/test/pleroma/web/plugs/http_security_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.HTTPSecurityPlugTest do diff --git a/test/pleroma/web/plugs/http_signature_plug_test.exs b/test/pleroma/web/plugs/http_signature_plug_test.exs index 56ef6b06f..2d8fba3cd 100644 --- a/test/pleroma/web/plugs/http_signature_plug_test.exs +++ b/test/pleroma/web/plugs/http_signature_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.HTTPSignaturePlugTest do diff --git a/test/pleroma/web/plugs/idempotency_plug_test.exs b/test/pleroma/web/plugs/idempotency_plug_test.exs index dd8cda664..cc55d341f 100644 --- a/test/pleroma/web/plugs/idempotency_plug_test.exs +++ b/test/pleroma/web/plugs/idempotency_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.IdempotencyPlugTest do diff --git a/test/pleroma/web/plugs/instance_static_test.exs b/test/pleroma/web/plugs/instance_static_test.exs index 46f2ca6b1..f91021a16 100644 --- a/test/pleroma/web/plugs/instance_static_test.exs +++ b/test/pleroma/web/plugs/instance_static_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.InstanceStaticTest do diff --git a/test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs b/test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs index 00ce6492d..33eff1bc5 100644 --- a/test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs +++ b/test/pleroma/web/plugs/mapped_signature_to_identity_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.MappedSignatureToIdentityPlugTest do diff --git a/test/pleroma/web/plugs/o_auth_plug_test.exs b/test/pleroma/web/plugs/o_auth_plug_test.exs index 9e4be5559..8917eadd1 100644 --- a/test/pleroma/web/plugs/o_auth_plug_test.exs +++ b/test/pleroma/web/plugs/o_auth_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.OAuthPlugTest do diff --git a/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs b/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs index 9f6d3dc71..05d0973d8 100644 --- a/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs +++ b/test/pleroma/web/plugs/o_auth_scopes_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.OAuthScopesPlugTest do diff --git a/test/pleroma/web/plugs/plug_helper_test.exs b/test/pleroma/web/plugs/plug_helper_test.exs index 346113628..935d0200b 100644 --- a/test/pleroma/web/plugs/plug_helper_test.exs +++ b/test/pleroma/web/plugs/plug_helper_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.PlugHelperTest do diff --git a/test/pleroma/web/plugs/rate_limiter_test.exs b/test/pleroma/web/plugs/rate_limiter_test.exs index b7cfde1f7..b1ac76120 100644 --- a/test/pleroma/web/plugs/rate_limiter_test.exs +++ b/test/pleroma/web/plugs/rate_limiter_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.RateLimiterTest do diff --git a/test/pleroma/web/plugs/remote_ip_test.exs b/test/pleroma/web/plugs/remote_ip_test.exs index 4d98de2bd..aea0940f4 100644 --- a/test/pleroma/web/plugs/remote_ip_test.exs +++ b/test/pleroma/web/plugs/remote_ip_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.RemoteIpTest do diff --git a/test/pleroma/web/plugs/set_format_plug_test.exs b/test/pleroma/web/plugs/set_format_plug_test.exs index 21043f698..4d64fdde6 100644 --- a/test/pleroma/web/plugs/set_format_plug_test.exs +++ b/test/pleroma/web/plugs/set_format_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.SetFormatPlugTest do diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index 5261e67ae..4328b9d42 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.SetLocalePlugTest do diff --git a/test/pleroma/web/plugs/set_user_session_id_plug_test.exs b/test/pleroma/web/plugs/set_user_session_id_plug_test.exs index 9814c80d8..cbb7e643d 100644 --- a/test/pleroma/web/plugs/set_user_session_id_plug_test.exs +++ b/test/pleroma/web/plugs/set_user_session_id_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.SetUserSessionIdPlugTest do diff --git a/test/pleroma/web/plugs/uploaded_media_plug_test.exs b/test/pleroma/web/plugs/uploaded_media_plug_test.exs index 75f313282..ec46b0537 100644 --- a/test/pleroma/web/plugs/uploaded_media_plug_test.exs +++ b/test/pleroma/web/plugs/uploaded_media_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UploadedMediaPlugTest do diff --git a/test/pleroma/web/plugs/user_enabled_plug_test.exs b/test/pleroma/web/plugs/user_enabled_plug_test.exs index 999c6c49c..3243bc47a 100644 --- a/test/pleroma/web/plugs/user_enabled_plug_test.exs +++ b/test/pleroma/web/plugs/user_enabled_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UserEnabledPlugTest do diff --git a/test/pleroma/web/plugs/user_fetcher_plug_test.exs b/test/pleroma/web/plugs/user_fetcher_plug_test.exs index 902bee642..6ffa50f40 100644 --- a/test/pleroma/web/plugs/user_fetcher_plug_test.exs +++ b/test/pleroma/web/plugs/user_fetcher_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UserFetcherPlugTest do diff --git a/test/pleroma/web/plugs/user_is_admin_plug_test.exs b/test/pleroma/web/plugs/user_is_admin_plug_test.exs index 58996d5a4..4fc4153b5 100644 --- a/test/pleroma/web/plugs/user_is_admin_plug_test.exs +++ b/test/pleroma/web/plugs/user_is_admin_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UserIsAdminPlugTest do diff --git a/test/pleroma/web/plugs/user_is_staff_plug_test.exs b/test/pleroma/web/plugs/user_is_staff_plug_test.exs index a0c4061db..921703876 100644 --- a/test/pleroma/web/plugs/user_is_staff_plug_test.exs +++ b/test/pleroma/web/plugs/user_is_staff_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UserIsStaffPlugTest do diff --git a/test/pleroma/web/plugs/user_tracking_plug_test.exs b/test/pleroma/web/plugs/user_tracking_plug_test.exs index 8e9d59b99..742f04fea 100644 --- a/test/pleroma/web/plugs/user_tracking_plug_test.exs +++ b/test/pleroma/web/plugs/user_tracking_plug_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Plugs.UserTrackingPlugTest do diff --git a/test/pleroma/web/preload/providers/instance_test.exs b/test/pleroma/web/preload/providers/instance_test.exs index a401475ee..92a28576d 100644 --- a/test/pleroma/web/preload/providers/instance_test.exs +++ b/test/pleroma/web/preload/providers/instance_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Preload.Providers.InstanceTest do diff --git a/test/pleroma/web/preload/providers/timeline_test.exs b/test/pleroma/web/preload/providers/timeline_test.exs index 2ae2ca5fb..162aabd4a 100644 --- a/test/pleroma/web/preload/providers/timeline_test.exs +++ b/test/pleroma/web/preload/providers/timeline_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Preload.Providers.TimelineTest do diff --git a/test/pleroma/web/preload/providers/user_test.exs b/test/pleroma/web/preload/providers/user_test.exs index b7017ac20..e8ef8a9f0 100644 --- a/test/pleroma/web/preload/providers/user_test.exs +++ b/test/pleroma/web/preload/providers/user_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Preload.Providers.UserTest do diff --git a/test/pleroma/web/push/impl_test.exs b/test/pleroma/web/push/impl_test.exs index b3ca1a337..b8112cce5 100644 --- a/test/pleroma/web/push/impl_test.exs +++ b/test/pleroma/web/push/impl_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.Push.ImplTest do diff --git a/test/pleroma/web/rel_me_test.exs b/test/pleroma/web/rel_me_test.exs index 313b163b5..3cfced9df 100644 --- a/test/pleroma/web/rel_me_test.exs +++ b/test/pleroma/web/rel_me_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RelMeTest do diff --git a/test/pleroma/web/rich_media/helpers_test.exs b/test/pleroma/web/rich_media/helpers_test.exs index 689854fb6..630b3ca95 100644 --- a/test/pleroma/web/rich_media/helpers_test.exs +++ b/test/pleroma/web/rich_media/helpers_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RichMedia.HelpersTest do diff --git a/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs b/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs index 0c8203417..59b3330ba 100644 --- a/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs +++ b/test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrlTest do diff --git a/test/pleroma/web/rich_media/parser_test.exs b/test/pleroma/web/rich_media/parser_test.exs index 2fe7f1b0b..ffdc4e5d7 100644 --- a/test/pleroma/web/rich_media/parser_test.exs +++ b/test/pleroma/web/rich_media/parser_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RichMedia.ParserTest do diff --git a/test/pleroma/web/rich_media/parsers/twitter_card_test.exs b/test/pleroma/web/rich_media/parsers/twitter_card_test.exs index 2aacd29a3..e84a4e50a 100644 --- a/test/pleroma/web/rich_media/parsers/twitter_card_test.exs +++ b/test/pleroma/web/rich_media/parsers/twitter_card_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.RichMedia.Parsers.TwitterCardTest do diff --git a/test/pleroma/web/shout_channel_test.exs b/test/pleroma/web/shout_channel_test.exs index 5c86efe9f..e1de80593 100644 --- a/test/pleroma/web/shout_channel_test.exs +++ b/test/pleroma/web/shout_channel_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ShoutChannelTest do diff --git a/test/pleroma/web/static_fe/static_fe_controller_test.exs b/test/pleroma/web/static_fe/static_fe_controller_test.exs index 5752cffda..2fae83305 100644 --- a/test/pleroma/web/static_fe/static_fe_controller_test.exs +++ b/test/pleroma/web/static_fe/static_fe_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.StaticFE.StaticFEControllerTest do diff --git a/test/pleroma/web/streamer_test.exs b/test/pleroma/web/streamer_test.exs index b2941a62c..4d4fed070 100644 --- a/test/pleroma/web/streamer_test.exs +++ b/test/pleroma/web/streamer_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.StreamerTest do diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs index bca9e2dad..495d371d2 100644 --- a/test/pleroma/web/twitter_api/controller_test.exs +++ b/test/pleroma/web/twitter_api/controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.ControllerTest do diff --git a/test/pleroma/web/twitter_api/password_controller_test.exs b/test/pleroma/web/twitter_api/password_controller_test.exs index 45ab10a8a..26cca1345 100644 --- a/test/pleroma/web/twitter_api/password_controller_test.exs +++ b/test/pleroma/web/twitter_api/password_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do diff --git a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs index fa3b29006..a493dc9f6 100644 --- a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs +++ b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do diff --git a/test/pleroma/web/twitter_api/twitter_api_test.exs b/test/pleroma/web/twitter_api/twitter_api_test.exs index 2b8a4c3f5..b3cd80146 100644 --- a/test/pleroma/web/twitter_api/twitter_api_test.exs +++ b/test/pleroma/web/twitter_api/twitter_api_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do diff --git a/test/pleroma/web/twitter_api/util_controller_test.exs b/test/pleroma/web/twitter_api/util_controller_test.exs index ee658ddf6..c795fd501 100644 --- a/test/pleroma/web/twitter_api/util_controller_test.exs +++ b/test/pleroma/web/twitter_api/util_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do diff --git a/test/pleroma/web/uploader_controller_test.exs b/test/pleroma/web/uploader_controller_test.exs index fc278004e..17d5152b7 100644 --- a/test/pleroma/web/uploader_controller_test.exs +++ b/test/pleroma/web/uploader_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.UploaderControllerTest do diff --git a/test/pleroma/web/views/error_view_test.exs b/test/pleroma/web/views/error_view_test.exs index 42da8f458..b4a651f6b 100644 --- a/test/pleroma/web/views/error_view_test.exs +++ b/test/pleroma/web/views/error_view_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ErrorViewTest do diff --git a/test/pleroma/web/web_finger/web_finger_controller_test.exs b/test/pleroma/web/web_finger/web_finger_controller_test.exs index 66d79320f..b5be28e67 100644 --- a/test/pleroma/web/web_finger/web_finger_controller_test.exs +++ b/test/pleroma/web/web_finger/web_finger_controller_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do diff --git a/test/pleroma/web/web_finger_test.exs b/test/pleroma/web/web_finger_test.exs index 0a36d57e6..1cc6ae675 100644 --- a/test/pleroma/web/web_finger_test.exs +++ b/test/pleroma/web/web_finger_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.WebFingerTest do diff --git a/test/pleroma/workers/cron/digest_emails_worker_test.exs b/test/pleroma/workers/cron/digest_emails_worker_test.exs index b3ca6235b..851f4d63a 100644 --- a/test/pleroma/workers/cron/digest_emails_worker_test.exs +++ b/test/pleroma/workers/cron/digest_emails_worker_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.Cron.DigestEmailsWorkerTest do diff --git a/test/pleroma/workers/cron/new_users_digest_worker_test.exs b/test/pleroma/workers/cron/new_users_digest_worker_test.exs index f9ef265c2..84914876c 100644 --- a/test/pleroma/workers/cron/new_users_digest_worker_test.exs +++ b/test/pleroma/workers/cron/new_users_digest_worker_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.Cron.NewUsersDigestWorkerTest do diff --git a/test/pleroma/workers/purge_expired_activity_test.exs b/test/pleroma/workers/purge_expired_activity_test.exs index 98f30f61f..0372f54ca 100644 --- a/test/pleroma/workers/purge_expired_activity_test.exs +++ b/test/pleroma/workers/purge_expired_activity_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.PurgeExpiredActivityTest do diff --git a/test/pleroma/workers/purge_expired_filter_test.exs b/test/pleroma/workers/purge_expired_filter_test.exs index d10586be9..e8d45aaaa 100644 --- a/test/pleroma/workers/purge_expired_filter_test.exs +++ b/test/pleroma/workers/purge_expired_filter_test.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Workers.PurgeExpiredFilterTest do use Pleroma.DataCase, async: true use Oban.Testing, repo: Repo diff --git a/test/pleroma/workers/purge_expired_token_test.exs b/test/pleroma/workers/purge_expired_token_test.exs index 00cbd40cd..d891eb8bb 100644 --- a/test/pleroma/workers/purge_expired_token_test.exs +++ b/test/pleroma/workers/purge_expired_token_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.PurgeExpiredTokenTest do diff --git a/test/pleroma/workers/scheduled_activity_worker_test.exs b/test/pleroma/workers/scheduled_activity_worker_test.exs index 5558d5b5f..4b3dfb99e 100644 --- a/test/pleroma/workers/scheduled_activity_worker_test.exs +++ b/test/pleroma/workers/scheduled_activity_worker_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Workers.ScheduledActivityWorkerTest do diff --git a/test/pleroma/xml_builder_test.exs b/test/pleroma/xml_builder_test.exs index 9aae32cdc..be9d8dd34 100644 --- a/test/pleroma/xml_builder_test.exs +++ b/test/pleroma/xml_builder_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.XmlBuilderTest do diff --git a/test/support/api_spec_helpers.ex b/test/support/api_spec_helpers.ex index 886e72d73..df5132357 100644 --- a/test/support/api_spec_helpers.ex +++ b/test/support/api_spec_helpers.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Tests.ApiSpecHelpers do diff --git a/test/support/builders/activity_builder.ex b/test/support/builders/activity_builder.ex index 7c4950bfa..f1ca3951b 100644 --- a/test/support/builders/activity_builder.ex +++ b/test/support/builders/activity_builder.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Builders.ActivityBuilder do alias Pleroma.Web.ActivityPub.ActivityPub diff --git a/test/support/builders/user_builder.ex b/test/support/builders/user_builder.ex index 6bccbb35a..d6af30612 100644 --- a/test/support/builders/user_builder.ex +++ b/test/support/builders/user_builder.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Builders.UserBuilder do alias Pleroma.Repo alias Pleroma.User diff --git a/test/support/cachex_proxy.ex b/test/support/cachex_proxy.ex index de1f1c766..83ae5610f 100644 --- a/test/support/cachex_proxy.ex +++ b/test/support/cachex_proxy.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.CachexProxy do diff --git a/test/support/captcha/mock.ex b/test/support/captcha/mock.ex index 175ade131..53e000ed6 100644 --- a/test/support/captcha/mock.ex +++ b/test/support/captcha/mock.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Captcha.Mock do diff --git a/test/support/channel_case.ex b/test/support/channel_case.ex index 1fbf6f100..8cb23f5ab 100644 --- a/test/support/channel_case.ex +++ b/test/support/channel_case.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ChannelCase do diff --git a/test/support/cluster.ex b/test/support/cluster.ex index 524194cf4..1c923fb0c 100644 --- a/test/support/cluster.ex +++ b/test/support/cluster.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Cluster do @moduledoc """ Facilities for managing a cluster of slave VM's for federated testing. diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex index eab469833..f010fec33 100644 --- a/test/support/conn_case.ex +++ b/test/support/conn_case.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ConnCase do diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 0ee2aa4a2..3c9cab061 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.DataCase do diff --git a/test/support/factory.ex b/test/support/factory.ex index 4a78425ce..09456debf 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Factory do diff --git a/test/support/helpers.ex b/test/support/helpers.ex index 34f1505d0..0bd487f39 100644 --- a/test/support/helpers.ex +++ b/test/support/helpers.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Tests.Helpers do diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index b99d70cda..ad4925a5c 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule HttpRequestMock do diff --git a/test/support/mocks.ex b/test/support/mocks.ex index fd8f825b3..d167996bd 100644 --- a/test/support/mocks.ex +++ b/test/support/mocks.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only Mox.defmock(Pleroma.CachexMock, for: Pleroma.Caching) diff --git a/test/support/mrf_module_mock.ex b/test/support/mrf_module_mock.ex index 4d21d7fe0..616fc720e 100644 --- a/test/support/mrf_module_mock.ex +++ b/test/support/mrf_module_mock.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule MRFModuleMock do diff --git a/test/support/null_cache.ex b/test/support/null_cache.ex index 47c10ebb6..9f1d45f1d 100644 --- a/test/support/null_cache.ex +++ b/test/support/null_cache.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.NullCache do diff --git a/test/support/oban_helpers.ex b/test/support/oban_helpers.ex index 9b6e5256e..94170a0f8 100644 --- a/test/support/oban_helpers.ex +++ b/test/support/oban_helpers.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Tests.ObanHelpers do diff --git a/test/support/websocket_client.ex b/test/support/websocket_client.ex index 34b955474..d149b324e 100644 --- a/test/support/websocket_client.ex +++ b/test/support/websocket_client.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Integration.WebsocketClient do diff --git a/test/test_helper.exs b/test/test_helper.exs index 9fb41e985..60a61484f 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only os_exclude = if :os.type() == {:unix, :darwin}, do: [skip_on_mac: true], else: [] -- cgit v1.2.3 From 8b0c2890f99feae374628d96ae1e65949e7631f5 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 1 Mar 2022 20:27:45 -0500 Subject: Fix digest test --- test/mix/tasks/pleroma/digest_test.exs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/mix/tasks/pleroma/digest_test.exs b/test/mix/tasks/pleroma/digest_test.exs index 4a9e461a9..b8050c7af 100644 --- a/test/mix/tasks/pleroma/digest_test.exs +++ b/test/mix/tasks/pleroma/digest_test.exs @@ -53,7 +53,13 @@ defmodule Mix.Tasks.Pleroma.DigestTest do assert_email_sent( to: {user2.name, user2.email}, - html_body: ~r/here is what you've missed!/i + html_body: + Regex.compile!( + "here is what you've missed!" + |> Phoenix.HTML.html_escape() + |> Phoenix.HTML.safe_to_string(), + "i" + ) ) end end -- cgit v1.2.3 From 0149ea453868b701d949a5cfee429dfd9d78bb65 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 1 Mar 2022 21:24:17 -0500 Subject: Send emails i18n'd using backend-stored user language --- test/pleroma/emails/user_email_test.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/pleroma/emails/user_email_test.exs b/test/pleroma/emails/user_email_test.exs index 21fd06ea6..771a9a490 100644 --- a/test/pleroma/emails/user_email_test.exs +++ b/test/pleroma/emails/user_email_test.exs @@ -56,4 +56,16 @@ defmodule Pleroma.Emails.UserEmailTest do assert email.subject == "Your account is awaiting approval" assert email.html_body =~ "Awaiting Approval" end + + test "email i18n" do + user = insert(:user, language: "en_test") + email = UserEmail.approval_pending_email(user) + assert email.subject == "xxYour account is awaiting approvalxx" + end + + test "email i18n should fallback to default locale if user language is unsupported" do + user = insert(:user, language: "unsupported") + email = UserEmail.approval_pending_email(user) + assert email.subject == "Your account is awaiting approval" + end end -- cgit v1.2.3 From e644f8dea52cb823076f63a18b18c1566c5190b6 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 2 Mar 2022 01:41:13 -0500 Subject: Allow user to register with custom language --- .../controllers/account_controller_test.exs | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index f272ed1ae..d5978372b 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -13,6 +13,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do alias Pleroma.Web.ActivityPub.InternalFetchActor alias Pleroma.Web.CommonAPI alias Pleroma.Web.OAuth.Token + alias Pleroma.Web.Plugs.SetLocalePlug import Pleroma.Factory @@ -1662,6 +1663,75 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do end end + describe "create account with language" do + setup %{conn: conn} do + app_token = insert(:oauth_token, user: nil) + + conn = + conn + |> put_req_header("authorization", "Bearer " <> app_token.token) + |> put_req_header("content-type", "multipart/form-data") + |> put_req_cookie(SetLocalePlug.frontend_language_cookie_name(), "zh-Hans") + |> SetLocalePlug.call([]) + + [conn: conn] + end + + test "creates an account with language parameter", %{conn: conn} do + params = %{ + username: "foo", + email: "foo@example.org", + password: "dupa.8", + agreement: true, + language: "ru" + } + + res = + conn + |> post("/api/v1/accounts", params) + + assert json_response_and_validate_schema(res, 200) + + assert %{language: "ru"} = Pleroma.User.get_by_nickname("foo") + end + + test "language parameter should be normalized", %{conn: conn} do + params = %{ + username: "foo", + email: "foo@example.org", + password: "dupa.8", + agreement: true, + language: "ru-RU" + } + + res = + conn + |> post("/api/v1/accounts", params) + + assert json_response_and_validate_schema(res, 200) + + assert %{language: "ru_RU"} = Pleroma.User.get_by_nickname("foo") + end + + test "createing an account without language parameter should fallback to cookie/header language", + %{conn: conn} do + params = %{ + username: "foo2", + email: "foo2@example.org", + password: "dupa.8", + agreement: true + } + + res = + conn + |> post("/api/v1/accounts", params) + + assert json_response_and_validate_schema(res, 200) + + assert %{language: "zh_Hans"} = Pleroma.User.get_by_nickname("foo2") + end + end + describe "GET /api/v1/accounts/:id/lists - account_lists" do test "returns lists to which the account belongs" do %{user: user, conn: conn} = oauth_access(["read:lists"]) -- cgit v1.2.3 From 8de573b04783ef50b74bd629843a58b37c0ce31d Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 2 Mar 2022 19:59:11 -0500 Subject: Fallback to a variant if the language in general is not supported For an example, here, zh is not supported, but zh_Hans and zh_Hant are. If the user asks for zh, we should choose a variant for them instead of fallbacking to default. Some browsers (e.g. Firefox) does not allow users to customize their language codes. For example, there is no zh-Hans, but only zh, zh-CN, zh-TW, zh-HK, etc. This provides a workaround for those users suffering from bad design decisions. --- test/pleroma/web/plugs/set_locale_plug_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index 043d7eb18..349326c24 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -47,6 +47,20 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do assert %{locale: "zh_Hans"} == conn.assigns end + test "fallback to some variant of the language if the unqualified language is not supported" do + conn = + :get + |> conn("/cofe") + |> Conn.put_req_header( + "accept-language", + "zh;q=0.9, en;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "zh_" <> _ = Gettext.get_locale() + assert %{locale: "zh_" <> _} = conn.assigns + end + test "use supported locale from cookie" do conn = :get -- cgit v1.2.3 From bc59da96c52a0fe751154dd98405e11817029b23 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 2 Mar 2022 20:04:30 -0500 Subject: Add test for fallbacking to a general language --- test/pleroma/web/plugs/set_locale_plug_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index 349326c24..f5d3ab995 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -33,6 +33,20 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do assert %{locale: "ru"} == conn.assigns end + test "fallback to the general language if a variant is not supported" do + conn = + :get + |> conn("/cofe") + |> Conn.put_req_header( + "accept-language", + "ru-CA;q=0.9, en;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "ru" == Gettext.get_locale() + assert %{locale: "ru"} == conn.assigns + end + test "use supported locale with specifiers from `accept-language`" do conn = :get -- cgit v1.2.3 From 7ea330b4fe1c93eb7caba2631e1adf133708fa20 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 3 Mar 2022 02:03:44 -0500 Subject: Support multiple locales formally elixir gettext current does not fully support fallback to another language [0]. But it might in the future. We adapt it so that all languages in Accept-Language headers are received by Pleroma.Web.Gettext. User.languages is now a comma-separated list. [0]: https://github.com/elixir-gettext/gettext/issues/303 --- test/pleroma/web/plugs/set_locale_plug_test.exs | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index f5d3ab995..b0e7afffd 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -16,7 +16,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "en" == Gettext.get_locale() - assert %{locale: "en"} == conn.assigns + assert %{locale: "en"} = conn.assigns end test "use supported locale from `accept-language`" do @@ -30,7 +30,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "ru" == Gettext.get_locale() - assert %{locale: "ru"} == conn.assigns + assert %{locale: "ru"} = conn.assigns end test "fallback to the general language if a variant is not supported" do @@ -44,7 +44,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "ru" == Gettext.get_locale() - assert %{locale: "ru"} == conn.assigns + assert %{locale: "ru"} = conn.assigns end test "use supported locale with specifiers from `accept-language`" do @@ -58,7 +58,21 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "zh_Hans" == Gettext.get_locale() - assert %{locale: "zh_Hans"} == conn.assigns + assert %{locale: "zh_Hans"} = conn.assigns + end + + test "it assigns all supported locales" do + conn = + :get + |> conn("/cofe") + |> Conn.put_req_header( + "accept-language", + "ru, fr-CH, fr;q=0.9, en;q=0.8, x-unsupported;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "ru" == Gettext.get_locale() + assert %{locale: "ru", locales: ["ru", "fr", "en"]} = conn.assigns end test "fallback to some variant of the language if the unqualified language is not supported" do @@ -87,7 +101,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "zh_Hans" == Gettext.get_locale() - assert %{locale: "zh_Hans"} == conn.assigns + assert %{locale: "zh_Hans"} = conn.assigns end test "fallback to supported locale from `accept-language` if locale in cookie not supported" do @@ -102,7 +116,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "ru" == Gettext.get_locale() - assert %{locale: "ru"} == conn.assigns + assert %{locale: "ru"} = conn.assigns end test "fallback to default if nothing is supported" do @@ -117,7 +131,7 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "en" == Gettext.get_locale() - assert %{locale: "en"} == conn.assigns + assert %{locale: "en"} = conn.assigns end test "use default locale if locale from `accept-language` is not supported" do @@ -128,6 +142,6 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "en" == Gettext.get_locale() - assert %{locale: "en"} == conn.assigns + assert %{locale: "en"} = conn.assigns end end -- cgit v1.2.3 From aca11fb70ef7d9f4004d6efd10fb39261f476852 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 3 Mar 2022 02:31:36 -0500 Subject: Support multiple locales from userLanguage cookie --- test/pleroma/web/plugs/set_locale_plug_test.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index b0e7afffd..ff04a859e 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -75,6 +75,21 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do assert %{locale: "ru", locales: ["ru", "fr", "en"]} = conn.assigns end + test "it assigns all supported locales in cookie" do + conn = + :get + |> conn("/cofe") + |> put_req_cookie(SetLocalePlug.frontend_language_cookie_name(), "zh-Hans,uk,zh-Hant") + |> Conn.put_req_header( + "accept-language", + "ru, fr-CH, fr;q=0.9, en;q=0.8, x-unsupported;q=0.8, *;q=0.5" + ) + |> SetLocalePlug.call([]) + + assert "zh_Hans" == Gettext.get_locale() + assert %{locale: "zh_Hans", locales: ["zh_Hans", "uk", "zh_Hant", "ru", "fr", "en"]} = conn.assigns + end + test "fallback to some variant of the language if the unqualified language is not supported" do conn = :get -- cgit v1.2.3 From cd42e2bed0039ce4939e4c55fb7fcd7cf2568b44 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 3 Mar 2022 09:40:18 -0500 Subject: Lint --- test/pleroma/web/plugs/set_locale_plug_test.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/plugs/set_locale_plug_test.exs b/test/pleroma/web/plugs/set_locale_plug_test.exs index ff04a859e..f9d34bbe4 100644 --- a/test/pleroma/web/plugs/set_locale_plug_test.exs +++ b/test/pleroma/web/plugs/set_locale_plug_test.exs @@ -87,7 +87,9 @@ defmodule Pleroma.Web.Plugs.SetLocalePlugTest do |> SetLocalePlug.call([]) assert "zh_Hans" == Gettext.get_locale() - assert %{locale: "zh_Hans", locales: ["zh_Hans", "uk", "zh_Hant", "ru", "fr", "en"]} = conn.assigns + + assert %{locale: "zh_Hans", locales: ["zh_Hans", "uk", "zh_Hant", "ru", "fr", "en"]} = + conn.assigns end test "fallback to some variant of the language if the unqualified language is not supported" do -- cgit v1.2.3 From 89667189b840fc79d85336739e6b2512684d7be0 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 6 Mar 2022 17:36:30 +0100 Subject: Delete report notifs when demoting from superuser When someone isn't a superuser any more, they shouldn't see the reporsts any more either. Here we delete the report notifications from a user when that user gets updated from being a superuser to a non-superuser. --- test/pleroma/notification_test.exs | 19 +++++++++++++++++++ test/pleroma/user_test.exs | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'test') diff --git a/test/pleroma/notification_test.exs b/test/pleroma/notification_test.exs index 716af496d..b47edd0a3 100644 --- a/test/pleroma/notification_test.exs +++ b/test/pleroma/notification_test.exs @@ -520,6 +520,25 @@ defmodule Pleroma.NotificationTest do end end + describe "destroy_multiple_from_types/2" do + test "clears all notifications of a certain type for a given user" do + report_activity = insert(:report_activity) + user1 = insert(:user, is_moderator: true, is_admin: true) + user2 = insert(:user, is_moderator: true, is_admin: true) + {:ok, _} = Notification.create_notifications(report_activity) + + {:ok, _} = + CommonAPI.post(user2, %{ + status: "hey @#{user1.nickname} !" + }) + + Notification.destroy_multiple_from_types(user1, ["pleroma:report"]) + + assert [%Pleroma.Notification{type: "mention"}] = Notification.for_user(user1) + assert [%Pleroma.Notification{type: "pleroma:report"}] = Notification.for_user(user2) + end + end + describe "set_read_up_to()" do test "it sets all notifications as read up to a specified notification ID" do user = insert(:user) diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index a9a3004a8..d44e1bc36 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.UserTest do alias Pleroma.Activity alias Pleroma.Builders.UserBuilder + alias Pleroma.Notification alias Pleroma.Object alias Pleroma.Repo alias Pleroma.Tests.ObanHelpers @@ -2210,6 +2211,26 @@ defmodule Pleroma.UserTest do assert {:ok, user} = Cachex.get(:user_cache, "ap_id:#{user.ap_id}") assert %User{bio: "test-bio"} = User.get_cached_by_ap_id(user.ap_id) end + + test "removes report notifs when user isn't superuser any more" do + report_activity = insert(:report_activity) + user = insert(:user, is_moderator: true, is_admin: true) + {:ok, _} = Notification.create_notifications(report_activity) + + assert [%Pleroma.Notification{type: "pleroma:report"}] = Notification.for_user(user) + + {:ok, user} = user |> User.admin_api_update(%{is_moderator: false}) + # is still superuser because still admin + assert [%Pleroma.Notification{type: "pleroma:report"}] = Notification.for_user(user) + + {:ok, user} = user |> User.admin_api_update(%{is_moderator: true, is_admin: false}) + # is still superuser because still moderator + assert [%Pleroma.Notification{type: "pleroma:report"}] = Notification.for_user(user) + + {:ok, user} = user |> User.admin_api_update(%{is_moderator: false}) + # is not a superuser any more + assert [] = Notification.for_user(user) + end end describe "following/followers synchronization" do -- cgit v1.2.3 From 79ccb6b9998ffffa32ba059c8e97f0f604db81f6 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sun, 6 Mar 2022 11:43:31 -0500 Subject: Support fallbacking to other languages --- test/pleroma/web/gettext_test.exs | 162 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 test/pleroma/web/gettext_test.exs (limited to 'test') diff --git a/test/pleroma/web/gettext_test.exs b/test/pleroma/web/gettext_test.exs new file mode 100644 index 000000000..9ede4827e --- /dev/null +++ b/test/pleroma/web/gettext_test.exs @@ -0,0 +1,162 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.GettextTest do + use ExUnit.Case + + require Pleroma.Web.Gettext + + test "put_locales/1: set the first in the list to Gettext's locale" do + Pleroma.Web.Gettext.put_locales(["zh_Hans", "en_test"]) + + assert "zh_Hans" == Gettext.get_locale(Pleroma.Web.Gettext) + end + + test "with_locales/2: reset locale on exit" do + old_first_locale = Gettext.get_locale(Pleroma.Web.Gettext) + old_locales = Pleroma.Web.Gettext.get_locales() + + Pleroma.Web.Gettext.with_locales ["zh_Hans", "en_test"] do + assert "zh_Hans" == Gettext.get_locale(Pleroma.Web.Gettext) + assert ["zh_Hans", "en_test"] == Pleroma.Web.Gettext.get_locales() + end + + assert old_first_locale == Gettext.get_locale(Pleroma.Web.Gettext) + assert old_locales == Pleroma.Web.Gettext.get_locales() + end + + describe "handle_missing_translation/5" do + test "fallback to next locale if some translation is not available" do + Pleroma.Web.Gettext.with_locales ["x_unsupported", "en_test"] do + assert "xxYour account is awaiting approvalxx" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "approval pending email subject", + "Your account is awaiting approval" + ) + end + end + + test "duplicated locale in list should not result in infinite loops" do + Pleroma.Web.Gettext.with_locales ["x_unsupported", "x_unsupported", "en_test"] do + assert "xxYour account is awaiting approvalxx" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "approval pending email subject", + "Your account is awaiting approval" + ) + end + end + + test "direct interpolation" do + Pleroma.Web.Gettext.with_locales ["en_test"] do + assert "xxYour digest from some instancexx" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "digest email subject", + "Your digest from %{instance_name}", + instance_name: "some instance" + ) + end + end + + test "fallback with interpolation" do + Pleroma.Web.Gettext.with_locales ["x_unsupported", "en_test"] do + assert "xxYour digest from some instancexx" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "digest email subject", + "Your digest from %{instance_name}", + instance_name: "some instance" + ) + end + end + + test "fallback to msgid" do + Pleroma.Web.Gettext.with_locales ["x_unsupported"] do + assert "Your digest from some instance" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "digest email subject", + "Your digest from %{instance_name}", + instance_name: "some instance" + ) + end + end + end + + describe "handle_missing_plural_translation/7" do + test "direct interpolation" do + Pleroma.Web.Gettext.with_locales ["en_test"] do + assert "xx1 New Followerxx" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 1, + count: 1 + ) + + assert "xx5 New Followersxx" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 5, + count: 5 + ) + end + end + + test "fallback with interpolation" do + Pleroma.Web.Gettext.with_locales ["x_unsupported", "en_test"] do + assert "xx1 New Followerxx" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 1, + count: 1 + ) + + assert "xx5 New Followersxx" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 5, + count: 5 + ) + end + end + + test "fallback to msgid" do + Pleroma.Web.Gettext.with_locales ["x_unsupported"] do + assert "1 New Follower" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 1, + count: 1 + ) + + assert "5 New Followers" == + Pleroma.Web.Gettext.dpngettext( + "static_pages", + "new followers count header", + "%{count} New Follower", + "%{count} New Followers", + 5, + count: 5 + ) + end + end + end +end -- cgit v1.2.3 From d7af67012f64d09bb50259188473c1c94418b3a2 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 00:06:07 -0500 Subject: Implement first pass of announcement admin api CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/2836 CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/1470 --- .../controllers/announcement_controller_test.exs | 94 ++++++++++++++++++++++ test/support/factory.ex | 8 ++ 2 files changed, 102 insertions(+) create mode 100644 test/pleroma/web/admin_api/controllers/announcement_controller_test.exs (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs new file mode 100644 index 000000000..d667526c3 --- /dev/null +++ b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs @@ -0,0 +1,94 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do + use Pleroma.Web.ConnCase + + import Pleroma.Factory + + setup do + admin = insert(:user, is_admin: true) + token = insert(:oauth_admin_token, user: admin) + + conn = + build_conn() + |> assign(:user, admin) + |> assign(:token, token) + + {:ok, %{admin: admin, token: token, conn: conn}} + end + + describe "GET /api/v1/pleroma/admin/announcements" do + test "it lists all announcements", %{conn: conn} do + %{id: id} = insert(:announcement) + + response = + conn + |> get("/api/v1/pleroma/admin/announcements") + |> json_response_and_validate_schema(:ok) + + assert [%{"id" => ^id}] = response + end + end + + describe "GET /api/v1/pleroma/admin/announcements/:id" do + test "it displays one announcement", %{conn: conn} do + %{id: id} = insert(:announcement) + + response = + conn + |> get("/api/v1/pleroma/admin/announcements/#{id}") + |> json_response_and_validate_schema(:ok) + + assert %{"id" => ^id} = response + end + + test "it returns not found for non-existent id", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> get("/api/v1/pleroma/admin/announcements/#{id}xxx") + |> json_response_and_validate_schema(:not_found) + end + end + + describe "DELETE /api/v1/pleroma/admin/announcements/:id" do + test "it deletes specified announcement", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> delete("/api/v1/pleroma/admin/announcements/#{id}") + |> json_response_and_validate_schema(:ok) + end + + test "it returns not found for non-existent id", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> get("/api/v1/pleroma/admin/announcements/#{id}xxx") + |> json_response_and_validate_schema(:not_found) + + assert %{id: ^id} = Pleroma.Announcement.get_by_id(id) + end + end + + describe "POST /api/v1/pleroma/admin/announcements" do + test "it creates an announcement", %{conn: conn} do + content = "test post announcement api" + + response = + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/pleroma/admin/announcements", %{ + "content" => content + }) + |> json_response_and_validate_schema(:ok) + + assert %{"content" => ^content} = response + end + end +end diff --git a/test/support/factory.ex b/test/support/factory.ex index 09456debf..85ea49cb2 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -627,4 +627,12 @@ defmodule Pleroma.Factory do context: ["home"] } end + + def announcement_factory do + %Pleroma.Announcement{ + data: %{ + "content" => "test announcement" + } + } + end end -- cgit v1.2.3 From 5169ad8f143d613f3fa179f88e2be6a16445df41 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 12:07:21 -0500 Subject: Implement announcement read relationships --- .../announcement_read_relationship_test.exs | 40 ++++++++++++++++ .../controllers/announcement_controller_test.exs | 54 ++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 test/pleroma/announcement_read_relationship_test.exs create mode 100644 test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs (limited to 'test') diff --git a/test/pleroma/announcement_read_relationship_test.exs b/test/pleroma/announcement_read_relationship_test.exs new file mode 100644 index 000000000..5fd4ffbef --- /dev/null +++ b/test/pleroma/announcement_read_relationship_test.exs @@ -0,0 +1,40 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.AnnouncementReadRelationshipTest do + alias Pleroma.AnnouncementReadRelationship + + use Pleroma.DataCase, async: true + + import Pleroma.Factory + + setup do + {:ok, user: insert(:user), announcement: insert(:announcement)} + end + + describe "mark_read/2" do + test "should insert relationship", %{user: user, announcement: announcement} do + {:ok, _} = AnnouncementReadRelationship.mark_read(user, announcement) + + assert AnnouncementReadRelationship.exists?(user, announcement) + end + end + + describe "mark_unread/2" do + test "should delete relationship", %{user: user, announcement: announcement} do + {:ok, _} = AnnouncementReadRelationship.mark_read(user, announcement) + + assert :ok = AnnouncementReadRelationship.mark_unread(user, announcement) + refute AnnouncementReadRelationship.exists?(user, announcement) + end + + test "should not fail if relationship does not exist", %{ + user: user, + announcement: announcement + } do + assert :ok = AnnouncementReadRelationship.mark_unread(user, announcement) + refute AnnouncementReadRelationship.exists?(user, announcement) + end + end +end diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs new file mode 100644 index 000000000..134db5fcc --- /dev/null +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -0,0 +1,54 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do + use Pleroma.Web.ConnCase + + import Pleroma.Factory + + alias Pleroma.AnnouncementReadRelationship + + describe "GET /api/v1/announcements" do + test "it lists all announcements" do + %{id: id} = insert(:announcement) + + response = + build_conn() + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [%{"id" => ^id}] = response + refute Map.has_key?(Enum.at(response, 0), "read") + end + + test "when authenticated, also expose read property" do + %{id: id} = insert(:announcement) + + %{conn: conn} = oauth_access(["read:accounts"]) + + response = + conn + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [%{"id" => ^id, "read" => false}] = response + end + + test "when authenticated and announcement is read by user" do + %{id: id} = announcement = insert(:announcement) + user = insert(:user) + + AnnouncementReadRelationship.mark_read(user, announcement) + + %{conn: conn} = oauth_access(["read:accounts"], user: user) + + response = + conn + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [%{"id" => ^id, "read" => true}] = response + end + end +end -- cgit v1.2.3 From aa1fff279e98c6d16095538382413d3b870cee2b Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 16:19:35 -0500 Subject: Implement GET /api/v1/announcements/:id --- .../controllers/announcement_controller_test.exs | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index 134db5fcc..090a2706b 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -51,4 +51,56 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert [%{"id" => ^id, "read" => true}] = response end end + + describe "GET /api/v1/announcements/:id" do + test "it shows one announcement" do + %{id: id} = insert(:announcement) + + response = + build_conn() + |> get("/api/v1/announcements/#{id}") + |> json_response_and_validate_schema(:ok) + + assert %{"id" => ^id} = response + refute Map.has_key?(response, "read") + end + + test "it gives 404 for non-existent announcements" do + %{id: id} = insert(:announcement) + + _response = + build_conn() + |> get("/api/v1/announcements/#{id}xxx") + |> json_response_and_validate_schema(:not_found) + end + + test "when authenticated, also expose read property" do + %{id: id} = insert(:announcement) + + %{conn: conn} = oauth_access(["read:accounts"]) + + response = + conn + |> get("/api/v1/announcements/#{id}") + |> json_response_and_validate_schema(:ok) + + assert %{"id" => ^id, "read" => false} = response + end + + test "when authenticated and announcement is read by user" do + %{id: id} = announcement = insert(:announcement) + user = insert(:user) + + AnnouncementReadRelationship.mark_read(user, announcement) + + %{conn: conn} = oauth_access(["read:accounts"], user: user) + + response = + conn + |> get("/api/v1/announcements/#{id}") + |> json_response_and_validate_schema(:ok) + + assert %{"id" => ^id, "read" => true} = response + end + end end -- cgit v1.2.3 From 2b39b36e490fc1222d8f3d737cb26e62af294e03 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 16:59:20 -0500 Subject: Implement POST /api/v1/announcements/:id/dismiss --- .../controllers/announcement_controller_test.exs | 50 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index 090a2706b..aa056be6e 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -2,11 +2,12 @@ # Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do +defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do use Pleroma.Web.ConnCase import Pleroma.Factory + alias Pleroma.Announcement alias Pleroma.AnnouncementReadRelationship describe "GET /api/v1/announcements" do @@ -103,4 +104,51 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert %{"id" => ^id, "read" => true} = response end end + + describe "POST /api/v1/announcements/:id/dismiss" do + setup do: oauth_access(["write:accounts"]) + + test "it requires auth", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> assign(:token, nil) + |> post("/api/v1/announcements/#{id}/dismiss") + |> json_response_and_validate_schema(:forbidden) + end + + test "it requires write:accounts oauth scope" do + %{id: id} = insert(:announcement) + + %{conn: conn} = oauth_access(["read:accounts"]) + + _response = + conn + |> post("/api/v1/announcements/#{id}/dismiss") + |> json_response_and_validate_schema(:forbidden) + end + + test "it gives 404 for non-existent announcements", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> post("/api/v1/announcements/#{id}xxx/dismiss") + |> json_response_and_validate_schema(:not_found) + end + + test "it marks announcement as read", %{user: user, conn: conn} do + %{id: id} = announcement = insert(:announcement) + + refute Announcement.read_by?(announcement, user) + + _response = + conn + |> post("/api/v1/announcements/#{id}/dismiss") + |> json_response_and_validate_schema(:ok) + + assert Announcement.read_by?(announcement, user) + end + end end -- cgit v1.2.3 From fcf3c9057ec1c49a0c9a400985c1dde4a5d7e9db Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 18:21:20 -0500 Subject: Implement visibility filtering for announcements --- test/pleroma/announcement_test.exs | 71 ++++++++++++++++++++++++++++++++++++++ test/support/factory.ex | 7 ++-- 2 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 test/pleroma/announcement_test.exs (limited to 'test') diff --git a/test/pleroma/announcement_test.exs b/test/pleroma/announcement_test.exs new file mode 100644 index 000000000..aa00f804b --- /dev/null +++ b/test/pleroma/announcement_test.exs @@ -0,0 +1,71 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.AnnouncementTest do + alias Pleroma.Announcement + + use Pleroma.DataCase, async: true + + import Pleroma.Factory + + describe "list_all_visible_when/1" do + setup do: {:ok, time: NaiveDateTime.utc_now()} + + test "with no start or end time", %{time: time} do + _announcement = insert(:announcement) + + assert [_] = Announcement.list_all_visible_when(time) + end + + test "with start time before current", %{time: time} do + before_now = NaiveDateTime.add(time, -10, :second) + + _announcement = insert(:announcement, %{starts_at: before_now}) + + assert [_] = Announcement.list_all_visible_when(time) + end + + test "with start time after current", %{time: time} do + after_now = NaiveDateTime.add(time, 10, :second) + + _announcement = insert(:announcement, %{starts_at: after_now}) + + assert [] = Announcement.list_all_visible_when(time) + end + + test "with end time after current", %{time: time} do + after_now = NaiveDateTime.add(time, 10, :second) + + _announcement = insert(:announcement, %{ends_at: after_now}) + + assert [_] = Announcement.list_all_visible_when(time) + end + + test "with end time before current", %{time: time} do + before_now = NaiveDateTime.add(time, -10, :second) + + _announcement = insert(:announcement, %{ends_at: before_now}) + + assert [] = Announcement.list_all_visible_when(time) + end + + test "with both start and end time", %{time: time} do + before_now = NaiveDateTime.add(time, -10, :second) + after_now = NaiveDateTime.add(time, 10, :second) + + _announcement = insert(:announcement, %{starts_at: before_now, ends_at: after_now}) + + assert [_] = Announcement.list_all_visible_when(time) + end + + test "with both start and end time, current not in the range", %{time: time} do + before_now = NaiveDateTime.add(time, -10, :second) + after_now = NaiveDateTime.add(time, 10, :second) + + _announcement = insert(:announcement, %{starts_at: after_now, ends_at: before_now}) + + assert [] = Announcement.list_all_visible_when(time) + end + end +end diff --git a/test/support/factory.ex b/test/support/factory.ex index 85ea49cb2..620102bbb 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -628,11 +628,10 @@ defmodule Pleroma.Factory do } end - def announcement_factory do + def announcement_factory(params \\ %{}, data \\ %{}) do %Pleroma.Announcement{ - data: %{ - "content" => "test announcement" - } + data: Map.merge(%{"content" => "test announcement"}, data) } + |> Map.merge(params) end end -- cgit v1.2.3 From cf8334dbc153eed7d65febb4ae4fd3c03bb106b2 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 19:12:01 -0500 Subject: Add starts_at, ends_at and all_day parameters --- .../controllers/announcement_controller_test.exs | 18 ++++++++++++++++-- test/support/factory.ex | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs index d667526c3..5c9d50120 100644 --- a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs @@ -80,15 +80,29 @@ defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do test "it creates an announcement", %{conn: conn} do content = "test post announcement api" + now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second) + starts_at = NaiveDateTime.add(now, -10, :second) + ends_at = NaiveDateTime.add(now, 10, :second) + response = conn |> put_req_header("content-type", "application/json") |> post("/api/v1/pleroma/admin/announcements", %{ - "content" => content + "content" => content, + "starts_at" => NaiveDateTime.to_iso8601(starts_at), + "ends_at" => NaiveDateTime.to_iso8601(ends_at), + "all_day" => true }) |> json_response_and_validate_schema(:ok) - assert %{"content" => ^content} = response + assert %{"content" => ^content, "all_day" => true} = response + + announcement = Pleroma.Announcement.get_by_id(response["id"]) + + assert not is_nil(announcement) + + assert NaiveDateTime.compare(announcement.starts_at, starts_at) == :eq + assert NaiveDateTime.compare(announcement.ends_at, ends_at) == :eq end end end diff --git a/test/support/factory.ex b/test/support/factory.ex index 620102bbb..64b0049ac 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -630,7 +630,7 @@ defmodule Pleroma.Factory do def announcement_factory(params \\ %{}, data \\ %{}) do %Pleroma.Announcement{ - data: Map.merge(%{"content" => "test announcement"}, data) + data: Map.merge(%{"content" => "test announcement", "all_day" => false}, data) } |> Map.merge(params) end -- cgit v1.2.3 From d569694ae91fa20654e5639989d3eec0ca3c8a54 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 19:17:49 -0500 Subject: Show only visible announcements in MastodonAPI --- .../controllers/announcement_controller_test.exs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index aa056be6e..e9ee1141c 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -23,6 +23,30 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do refute Map.has_key?(Enum.at(response, 0), "read") end + test "it does not list announcements starting after current time" do + time = NaiveDateTime.utc_now() |> NaiveDateTime.add(999999, :second) + insert(:announcement, starts_at: time) + + response = + build_conn() + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [] = response + end + + test "it does not list announcements ending before current time" do + time = NaiveDateTime.utc_now() |> NaiveDateTime.add(-999999, :second) + insert(:announcement, ends_at: time) + + response = + build_conn() + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [] = response + end + test "when authenticated, also expose read property" do %{id: id} = insert(:announcement) -- cgit v1.2.3 From 881179ec725c3b71868fdcba983fdedd295e5125 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 19:22:28 -0500 Subject: Remove GET /api/v1/announcements/:id --- .../controllers/announcement_controller_test.exs | 56 +--------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index e9ee1141c..1c748064c 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -24,7 +24,7 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do end test "it does not list announcements starting after current time" do - time = NaiveDateTime.utc_now() |> NaiveDateTime.add(999999, :second) + time = NaiveDateTime.utc_now() |> NaiveDateTime.add(999_999, :second) insert(:announcement, starts_at: time) response = @@ -36,7 +36,7 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do end test "it does not list announcements ending before current time" do - time = NaiveDateTime.utc_now() |> NaiveDateTime.add(-999999, :second) + time = NaiveDateTime.utc_now() |> NaiveDateTime.add(-999_999, :second) insert(:announcement, ends_at: time) response = @@ -77,58 +77,6 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do end end - describe "GET /api/v1/announcements/:id" do - test "it shows one announcement" do - %{id: id} = insert(:announcement) - - response = - build_conn() - |> get("/api/v1/announcements/#{id}") - |> json_response_and_validate_schema(:ok) - - assert %{"id" => ^id} = response - refute Map.has_key?(response, "read") - end - - test "it gives 404 for non-existent announcements" do - %{id: id} = insert(:announcement) - - _response = - build_conn() - |> get("/api/v1/announcements/#{id}xxx") - |> json_response_and_validate_schema(:not_found) - end - - test "when authenticated, also expose read property" do - %{id: id} = insert(:announcement) - - %{conn: conn} = oauth_access(["read:accounts"]) - - response = - conn - |> get("/api/v1/announcements/#{id}") - |> json_response_and_validate_schema(:ok) - - assert %{"id" => ^id, "read" => false} = response - end - - test "when authenticated and announcement is read by user" do - %{id: id} = announcement = insert(:announcement) - user = insert(:user) - - AnnouncementReadRelationship.mark_read(user, announcement) - - %{conn: conn} = oauth_access(["read:accounts"], user: user) - - response = - conn - |> get("/api/v1/announcements/#{id}") - |> json_response_and_validate_schema(:ok) - - assert %{"id" => ^id, "read" => true} = response - end - end - describe "POST /api/v1/announcements/:id/dismiss" do setup do: oauth_access(["write:accounts"]) -- cgit v1.2.3 From 11a1996bf5f283099fd9ecbb5c64e051ec46a5df Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 20:55:41 -0500 Subject: Implement update announcement admin api --- .../controllers/announcement_controller_test.exs | 80 +++++++++++++++++++++- test/support/factory.ex | 6 +- 2 files changed, 84 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs index 5c9d50120..c6b2163d0 100644 --- a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs @@ -69,11 +69,89 @@ defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do _response = conn - |> get("/api/v1/pleroma/admin/announcements/#{id}xxx") + |> delete("/api/v1/pleroma/admin/announcements/#{id}xxx") + |> json_response_and_validate_schema(:not_found) + + assert %{id: ^id} = Pleroma.Announcement.get_by_id(id) + end + end + + describe "PATCH /api/v1/pleroma/admin/announcements/:id" do + test "it returns not found for non-existent id", %{conn: conn} do + %{id: id} = insert(:announcement) + + _response = + conn + |> put_req_header("content-type", "application/json") + |> patch("/api/v1/pleroma/admin/announcements/#{id}xxx", %{}) |> json_response_and_validate_schema(:not_found) assert %{id: ^id} = Pleroma.Announcement.get_by_id(id) end + + test "it updates a field", %{conn: conn} do + %{id: id} = insert(:announcement) + + now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second) + starts_at = NaiveDateTime.add(now, -10, :second) + + _response = + conn + |> put_req_header("content-type", "application/json") + |> patch("/api/v1/pleroma/admin/announcements/#{id}", %{ + starts_at: NaiveDateTime.to_iso8601(starts_at) + }) + |> json_response_and_validate_schema(:ok) + + new = Pleroma.Announcement.get_by_id(id) + + assert NaiveDateTime.compare(new.starts_at, starts_at) == :eq + end + + test "it updates a data field", %{conn: conn} do + %{id: id} = announcement = insert(:announcement, data: %{"all_day" => true}) + + assert announcement.data["all_day"] == true + + new_content = "new content" + + response = + conn + |> put_req_header("content-type", "application/json") + |> patch("/api/v1/pleroma/admin/announcements/#{id}", %{ + content: new_content + }) + |> json_response_and_validate_schema(:ok) + + assert response["content"] == new_content + assert response["all_day"] == true + + new = Pleroma.Announcement.get_by_id(id) + + assert new.data["content"] == new_content + assert new.data["all_day"] == true + end + + test "it nullifies a nullable field", %{conn: conn} do + now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second) + starts_at = NaiveDateTime.add(now, -10, :second) + + %{id: id} = insert(:announcement, starts_at: starts_at) + + response = + conn + |> put_req_header("content-type", "application/json") + |> patch("/api/v1/pleroma/admin/announcements/#{id}", %{ + starts_at: nil + }) + |> json_response_and_validate_schema(:ok) + + assert response["starts_at"] == nil + + new = Pleroma.Announcement.get_by_id(id) + + assert new.starts_at == nil + end end describe "POST /api/v1/pleroma/admin/announcements" do diff --git a/test/support/factory.ex b/test/support/factory.ex index 64b0049ac..d28a56345 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -628,7 +628,11 @@ defmodule Pleroma.Factory do } end - def announcement_factory(params \\ %{}, data \\ %{}) do + def announcement_factory(params \\ %{}) do + data = Map.get(params, :data, %{}) + + {_, params} = Map.pop(params, :data) + %Pleroma.Announcement{ data: Map.merge(%{"content" => "test announcement", "all_day" => false}, data) } -- cgit v1.2.3 From eb1a29640f2d7c7d3daca0626b2beb623903c9cd Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 21:26:05 -0500 Subject: Add pagination to AdminAPI.AnnouncementController.index --- .../controllers/announcement_controller_test.exs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs index c6b2163d0..56da1c6aa 100644 --- a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs @@ -30,6 +30,54 @@ defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do assert [%{"id" => ^id}] = response end + + test "it paginates announcements", %{conn: conn} do + _announcements = Enum.map(0..20, fn _ -> insert(:announcement) end) + + response = + conn + |> get("/api/v1/pleroma/admin/announcements") + |> json_response_and_validate_schema(:ok) + + assert length(response) == 20 + end + + test "it paginates announcements with custom params", %{conn: conn} do + announcements = Enum.map(0..20, fn _ -> insert(:announcement) end) + + response = + conn + |> get("/api/v1/pleroma/admin/announcements", limit: 5, offset: 7) + |> json_response_and_validate_schema(:ok) + + assert length(response) == 5 + assert Enum.at(response, 0)["id"] == Enum.at(announcements, 7).id + end + + test "it returns empty list with out-of-bounds offset", %{conn: conn} do + _announcements = Enum.map(0..20, fn _ -> insert(:announcement) end) + + response = + conn + |> get("/api/v1/pleroma/admin/announcements", offset: 21) + |> json_response_and_validate_schema(:ok) + + assert [] = response + end + + test "it rejects invalid pagination params", %{conn: conn} do + conn + |> get("/api/v1/pleroma/admin/announcements", limit: 0) + |> json_response_and_validate_schema(400) + + conn + |> get("/api/v1/pleroma/admin/announcements", limit: -1) + |> json_response_and_validate_schema(400) + + conn + |> get("/api/v1/pleroma/admin/announcements", offset: -1) + |> json_response_and_validate_schema(400) + end end describe "GET /api/v1/pleroma/admin/announcements/:id" do -- cgit v1.2.3 From ebcda5265b9c82be26eae65b5ab39629a525c3fa Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 8 Mar 2022 23:00:51 -0500 Subject: Format announcements into html --- test/pleroma/announcement_test.exs | 27 +++++++++++++++++++++++++++ test/support/factory.ex | 1 + 2 files changed, 28 insertions(+) (limited to 'test') diff --git a/test/pleroma/announcement_test.exs b/test/pleroma/announcement_test.exs index aa00f804b..a007c3718 100644 --- a/test/pleroma/announcement_test.exs +++ b/test/pleroma/announcement_test.exs @@ -68,4 +68,31 @@ defmodule Pleroma.AnnouncementTest do assert [] = Announcement.list_all_visible_when(time) end end + + describe "announcements formatting" do + test "it formats links" do + raw = "something on https://pleroma.social ." + announcement = insert(:announcement, %{data: %{"content" => raw}}) + + assert announcement.rendered["content"] =~ ~r( raw}}) + + assert announcement.rendered["content"] =~ ~r( raw}}) + + assert announcement.rendered["content"] =~ ~r( "test announcement", "all_day" => false}, data) } |> Map.merge(params) + |> Pleroma.Announcement.add_rendered_properties() end end -- cgit v1.2.3 From 31ff467eff9ef1b4bd645c8c868ac669e86bc140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 16 Mar 2022 20:59:02 +0100 Subject: Use `types` for filtering notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../controllers/notification_controller_test.exs | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs index 2b7a95635..403628488 100644 --- a/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs @@ -423,7 +423,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do assert [%{"id" => ^reblog_notification_id}] = json_response_and_validate_schema(conn_res, 200) end - test "filters notifications using include_types" do + test "filters notifications using types" do %{user: user, conn: conn} = oauth_access(["read:notifications"]) other_user = insert(:user) @@ -438,21 +438,21 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do reblog_notification_id = get_notification_id_by_activity(reblog_activity) follow_notification_id = get_notification_id_by_activity(follow_activity) - conn_res = get(conn, "/api/v1/notifications?include_types[]=follow") + conn_res = get(conn, "/api/v1/notifications?types[]=follow") assert [%{"id" => ^follow_notification_id}] = json_response_and_validate_schema(conn_res, 200) - conn_res = get(conn, "/api/v1/notifications?include_types[]=mention") + conn_res = get(conn, "/api/v1/notifications?types[]=mention") assert [%{"id" => ^mention_notification_id}] = json_response_and_validate_schema(conn_res, 200) - conn_res = get(conn, "/api/v1/notifications?include_types[]=favourite") + conn_res = get(conn, "/api/v1/notifications?types[]=favourite") assert [%{"id" => ^favorite_notification_id}] = json_response_and_validate_schema(conn_res, 200) - conn_res = get(conn, "/api/v1/notifications?include_types[]=reblog") + conn_res = get(conn, "/api/v1/notifications?types[]=reblog") assert [%{"id" => ^reblog_notification_id}] = json_response_and_validate_schema(conn_res, 200) @@ -460,7 +460,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do assert length(result) == 4 - query = params_to_query(%{include_types: ["follow", "mention", "favourite", "reblog"]}) + query = params_to_query(%{types: ["follow", "mention", "favourite", "reblog"]}) result = conn @@ -470,6 +470,23 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do assert length(result) == 4 end + test "filtering falls back to include_types" do + %{user: user, conn: conn} = oauth_access(["read:notifications"]) + other_user = insert(:user) + + {:ok, _activity} = CommonAPI.post(other_user, %{status: "hey @#{user.nickname}"}) + {:ok, create_activity} = CommonAPI.post(user, %{status: "hey"}) + {:ok, _activity} = CommonAPI.favorite(other_user, create_activity.id) + {:ok, _activity} = CommonAPI.repeat(create_activity.id, other_user) + {:ok, _, _, follow_activity} = CommonAPI.follow(other_user, user) + + follow_notification_id = get_notification_id_by_activity(follow_activity) + + conn_res = get(conn, "/api/v1/notifications?include_types[]=follow") + + assert [%{"id" => ^follow_notification_id}] = json_response_and_validate_schema(conn_res, 200) + end + test "destroy multiple" do %{user: user, conn: conn} = oauth_access(["read:notifications", "write:notifications"]) other_user = insert(:user) -- cgit v1.2.3 From 030183b35f22001cf543bc94061614eb0348a0cf Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 9 Jan 2022 20:01:16 +0100 Subject: AttachmentValidator: Use custom ecto type and regex for "mediaType" --- .../attachment_validator_test.exs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs index b07011b76..9a17e277e 100644 --- a/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/attachment_validator_test.exs @@ -27,6 +27,46 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidatorTest do assert attachment.mediaType == "application/octet-stream" end + test "works with an unknown but valid mime type" do + attachment = %{ + "mediaType" => "x-custom/x-type", + "type" => "Document", + "url" => "https://example.org" + } + + assert {:ok, attachment} = + AttachmentValidator.cast_and_validate(attachment) + |> Ecto.Changeset.apply_action(:insert) + + assert attachment.mediaType == "x-custom/x-type" + end + + test "works with invalid mime types" do + attachment = %{ + "mediaType" => "x-customx-type", + "type" => "Document", + "url" => "https://example.org" + } + + assert {:ok, attachment} = + AttachmentValidator.cast_and_validate(attachment) + |> Ecto.Changeset.apply_action(:insert) + + assert attachment.mediaType == "application/octet-stream" + + attachment = %{ + "mediaType" => "https://example.org", + "type" => "Document", + "url" => "https://example.org" + } + + assert {:ok, attachment} = + AttachmentValidator.cast_and_validate(attachment) + |> Ecto.Changeset.apply_action(:insert) + + assert attachment.mediaType == "application/octet-stream" + end + test "it turns mastodon attachments into our attachments" do attachment = %{ "url" => -- cgit v1.2.3 From 0c78ab4a88d59358a0a5e24a76cbb4cdb2c2d402 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Fri, 18 Mar 2022 09:36:13 -0400 Subject: Use utc_datetime in db schema --- .../controllers/announcement_controller_test.exs | 47 ++++++++++++++++++++++ .../controllers/announcement_controller_test.exs | 24 +++++++++++ 2 files changed, 71 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs index 56da1c6aa..5b8148c05 100644 --- a/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/announcement_controller_test.exs @@ -156,6 +156,25 @@ defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do assert NaiveDateTime.compare(new.starts_at, starts_at) == :eq end + test "it updates with time with utc timezone", %{conn: conn} do + %{id: id} = insert(:announcement) + + now = DateTime.now("Etc/UTC") |> elem(1) |> DateTime.truncate(:second) + starts_at = DateTime.add(now, -10, :second) + + _response = + conn + |> put_req_header("content-type", "application/json") + |> patch("/api/v1/pleroma/admin/announcements/#{id}", %{ + starts_at: DateTime.to_iso8601(starts_at) + }) + |> json_response_and_validate_schema(:ok) + + new = Pleroma.Announcement.get_by_id(id) + + assert DateTime.compare(new.starts_at, starts_at) == :eq + end + test "it updates a data field", %{conn: conn} do %{id: id} = announcement = insert(:announcement, data: %{"all_day" => true}) @@ -230,5 +249,33 @@ defmodule Pleroma.Web.AdminAPI.AnnouncementControllerTest do assert NaiveDateTime.compare(announcement.starts_at, starts_at) == :eq assert NaiveDateTime.compare(announcement.ends_at, ends_at) == :eq end + + test "creating with time with utc timezones", %{conn: conn} do + content = "test post announcement api" + + now = DateTime.now("Etc/UTC") |> elem(1) |> DateTime.truncate(:second) + starts_at = DateTime.add(now, -10, :second) + ends_at = DateTime.add(now, 10, :second) + + response = + conn + |> put_req_header("content-type", "application/json") + |> post("/api/v1/pleroma/admin/announcements", %{ + "content" => content, + "starts_at" => DateTime.to_iso8601(starts_at), + "ends_at" => DateTime.to_iso8601(ends_at), + "all_day" => true + }) + |> json_response_and_validate_schema(:ok) + + assert %{"content" => ^content, "all_day" => true} = response + + announcement = Pleroma.Announcement.get_by_id(response["id"]) + + assert not is_nil(announcement) + + assert DateTime.compare(announcement.starts_at, starts_at) == :eq + assert DateTime.compare(announcement.ends_at, ends_at) == :eq + end end end diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index 1c748064c..3957cc3ed 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -23,6 +23,30 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do refute Map.has_key?(Enum.at(response, 0), "read") end + test "it returns time with utc timezone" do + start_time = + NaiveDateTime.utc_now() + |> NaiveDateTime.add(-999_999, :second) + |> NaiveDateTime.truncate(:second) + + end_time = + NaiveDateTime.utc_now() + |> NaiveDateTime.add(999_999, :second) + |> NaiveDateTime.truncate(:second) + + %{id: id} = insert(:announcement, %{starts_at: start_time, ends_at: end_time}) + + response = + build_conn() + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + + assert [%{"id" => ^id}] = [announcement] = response + + assert String.ends_with?(announcement["starts_at"], "Z") + assert String.ends_with?(announcement["ends_at"], "Z") + end + test "it does not list announcements starting after current time" do time = NaiveDateTime.utc_now() |> NaiveDateTime.add(999_999, :second) insert(:announcement, starts_at: time) -- cgit v1.2.3 From 7d1dae3befbecbeeb72768afe4f5a23a59ba4f05 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sat, 2 Apr 2022 02:25:13 -0400 Subject: Restrict mastodon api announcements to logged-in users only --- .../controllers/announcement_controller_test.exs | 43 ++++++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs index 3957cc3ed..60c9978c2 100644 --- a/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/announcement_controller_test.exs @@ -11,19 +11,40 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do alias Pleroma.AnnouncementReadRelationship describe "GET /api/v1/announcements" do - test "it lists all announcements" do + setup do + %{conn: conn} = oauth_access([]) + {:ok, conn: conn} + end + + test "it does not allow guests", %{conn: conn} do + _response = + conn + |> assign(:token, nil) + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:forbidden) + end + + test "it allows users with scopes" do + %{conn: conn} = oauth_access(["read:accounts"]) + + _response = + conn + |> get("/api/v1/announcements") + |> json_response_and_validate_schema(:ok) + end + + test "it lists all announcements", %{conn: conn} do %{id: id} = insert(:announcement) response = - build_conn() + conn |> get("/api/v1/announcements") |> json_response_and_validate_schema(:ok) assert [%{"id" => ^id}] = response - refute Map.has_key?(Enum.at(response, 0), "read") end - test "it returns time with utc timezone" do + test "it returns time with utc timezone", %{conn: conn} do start_time = NaiveDateTime.utc_now() |> NaiveDateTime.add(-999_999, :second) @@ -37,7 +58,7 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do %{id: id} = insert(:announcement, %{starts_at: start_time, ends_at: end_time}) response = - build_conn() + conn |> get("/api/v1/announcements") |> json_response_and_validate_schema(:ok) @@ -47,35 +68,33 @@ defmodule Pleroma.Web.MastodonAPI.AnnouncementControllerTest do assert String.ends_with?(announcement["ends_at"], "Z") end - test "it does not list announcements starting after current time" do + test "it does not list announcements starting after current time", %{conn: conn} do time = NaiveDateTime.utc_now() |> NaiveDateTime.add(999_999, :second) insert(:announcement, starts_at: time) response = - build_conn() + conn |> get("/api/v1/announcements") |> json_response_and_validate_schema(:ok) assert [] = response end - test "it does not list announcements ending before current time" do + test "it does not list announcements ending before current time", %{conn: conn} do time = NaiveDateTime.utc_now() |> NaiveDateTime.add(-999_999, :second) insert(:announcement, ends_at: time) response = - build_conn() + conn |> get("/api/v1/announcements") |> json_response_and_validate_schema(:ok) assert [] = response end - test "when authenticated, also expose read property" do + test "when authenticated, also expose read property", %{conn: conn} do %{id: id} = insert(:announcement) - %{conn: conn} = oauth_access(["read:accounts"]) - response = conn |> get("/api/v1/announcements") -- cgit v1.2.3 From 5f37db330f28556fa6c4c7b2559e6b4663ab4417 Mon Sep 17 00:00:00 2001 From: Ilja Date: Tue, 5 Apr 2022 13:21:09 +0200 Subject: Fix eratic test for POST /api/pleroma/admin/reports/:id/notes It retrieved two ReportNotes and then checked one of them. But the order isn't guaranteed, while the test tested on the content of the first ReportNote. I made the test on the content more generic --- test/pleroma/web/admin_api/controllers/report_controller_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs index 6211956c6..30dcb87e2 100644 --- a/test/pleroma/web/admin_api/controllers/report_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -355,7 +355,6 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do } = note end - @tag :erratic test "it returns reports with notes", %{conn: conn, admin: admin} do conn = get(conn, "/api/pleroma/admin/reports") @@ -364,7 +363,8 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do [note, _] = notes assert note["user"]["nickname"] == admin.nickname - assert note["content"] == "this is disgusting!" + # We use '=~' because the order of the notes isn't guaranteed + assert note["content"] =~ "this is disgusting" assert note["created_at"] assert response["total"] == 1 end -- cgit v1.2.3 From be08d9305b1dba9d146a1a1482e6728efb113285 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sun, 17 Apr 2022 22:39:52 -0400 Subject: Fix incorrect fallback when English is set to first language --- test/pleroma/web/gettext_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/gettext_test.exs b/test/pleroma/web/gettext_test.exs index 9ede4827e..e186f1ab3 100644 --- a/test/pleroma/web/gettext_test.exs +++ b/test/pleroma/web/gettext_test.exs @@ -38,6 +38,17 @@ defmodule Pleroma.Web.GettextTest do end end + test "putting en locale at the front should not make gettext fallback unexpectedly" do + Pleroma.Web.Gettext.with_locales ["en", "en_test"] do + assert "Your account is awaiting approval" == + Pleroma.Web.Gettext.dpgettext( + "static_pages", + "approval pending email subject", + "Your account is awaiting approval" + ) + end + end + test "duplicated locale in list should not result in infinite loops" do Pleroma.Web.Gettext.with_locales ["x_unsupported", "x_unsupported", "en_test"] do assert "xxYour account is awaiting approvalxx" == -- cgit v1.2.3 From e2d24eda5745310346b5e347efddbc68723612f0 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 5 May 2022 18:39:34 -0400 Subject: Allow to skip cache in Cache plug Ref: fix-local-public --- test/pleroma/web/plugs/cache_test.exs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/plugs/cache_test.exs b/test/pleroma/web/plugs/cache_test.exs index d84e2d268..0c119528d 100644 --- a/test/pleroma/web/plugs/cache_test.exs +++ b/test/pleroma/web/plugs/cache_test.exs @@ -179,4 +179,22 @@ defmodule Pleroma.Web.Plugs.CacheTest do |> send_resp(:im_a_teapot, "🥤") |> sent_resp() end + + test "ignores if skip_cache is assigned" do + assert @miss_resp == + conn(:get, "/") + |> assign(:skip_cache, true) + |> Cache.call(%{query_params: false, ttl: nil}) + |> put_resp_content_type("cofe/hot") + |> send_resp(:ok, "cofe") + |> sent_resp() + + assert @miss_resp == + conn(:get, "/") + |> assign(:skip_cache, true) + |> Cache.call(%{query_params: false, ttl: nil}) + |> put_resp_content_type("cofe/hot") + |> send_resp(:ok, "cofe") + |> sent_resp() + end end -- cgit v1.2.3 From 57c030a0a729f0ee87330d231ca6fb1151840a43 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 5 May 2022 19:20:32 -0400 Subject: Skip cache when /objects or /activities is authenticated Ref: fix-local-public --- .../activity_pub/activity_pub_controller_test.exs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs index 1923ec479..1c5c40e84 100644 --- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs +++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs @@ -291,6 +291,30 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert json_response(conn, 200) == ObjectView.render("object.json", %{object: note}) end + test "does not cache authenticated response", %{conn: conn} do + user = insert(:user) + reader = insert(:user) + + {:ok, post} = + CommonAPI.post(user, %{status: "test @#{reader.nickname}", visibility: "local"}) + + object = Object.normalize(post, fetch: false) + uuid = String.split(object.data["id"], "/") |> List.last() + + assert response = + conn + |> assign(:user, reader) + |> put_req_header("accept", "application/activity+json") + |> get("/objects/#{uuid}") + + json_response(response, 200) + + conn + |> put_req_header("accept", "application/activity+json") + |> get("/objects/#{uuid}") + |> json_response(404) + end + test "it returns 404 for non-public messages", %{conn: conn} do note = insert(:direct_note) uuid = String.split(note.data["id"], "/") |> List.last() -- cgit v1.2.3 From a8093732bd1f90a7b3c83b264cbddb96a578bafe Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 8 May 2022 18:10:40 +0000 Subject: Also use actor_type to determine if an account is a bot in antiFollowbotPolicy --- .../mrf/anti_followbot_policy_test.exs | 57 +++++++++++++++++----- 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs b/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs index d5af3a9b6..14a6ae52b 100644 --- a/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/anti_followbot_policy_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do use Pleroma.DataCase, async: true import Pleroma.Factory + alias Pleroma.User alias Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy describe "blocking based on attributes" do @@ -38,21 +39,55 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicyTest do assert {:reject, "[AntiFollowbotPolicy]" <> _} = AntiFollowbotPolicy.filter(message) end + + test "matches followbots by actor_type" do + actor = insert(:user, %{actor_type: "Service"}) + target = insert(:user) + + message = %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "type" => "Follow", + "actor" => actor.ap_id, + "object" => target.ap_id, + "id" => "https://example.com/activities/1234" + } + + assert {:reject, "[AntiFollowbotPolicy]" <> _} = AntiFollowbotPolicy.filter(message) + end end - test "it allows non-followbots" do - actor = insert(:user) - target = insert(:user) + describe "it allows" do + test "non-followbots" do + actor = insert(:user) + target = insert(:user) - message = %{ - "@context" => "https://www.w3.org/ns/activitystreams", - "type" => "Follow", - "actor" => actor.ap_id, - "object" => target.ap_id, - "id" => "https://example.com/activities/1234" - } + message = %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "type" => "Follow", + "actor" => actor.ap_id, + "object" => target.ap_id, + "id" => "https://example.com/activities/1234" + } - {:ok, _} = AntiFollowbotPolicy.filter(message) + {:ok, _} = AntiFollowbotPolicy.filter(message) + end + + test "bots if the target follows the bots" do + actor = insert(:user, %{actor_type: "Service"}) + target = insert(:user) + + User.follow(target, actor) + + message = %{ + "@context" => "https://www.w3.org/ns/activitystreams", + "type" => "Follow", + "actor" => actor.ap_id, + "object" => target.ap_id, + "id" => "https://example.com/activities/1234" + } + + {:ok, _} = AntiFollowbotPolicy.filter(message) + end end test "it gracefully handles nil display names" do -- cgit v1.2.3 From a74ce2d77a53873b3edceeda7287b299c7922a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne?= Date: Wed, 18 May 2022 21:25:10 +0200 Subject: StealEmojiPolicy: fix String rejected_shortcodes * rejected_shortcodes is defined as a list of strings in the configuration description. As such, database-based configuration was led to handle those settings as strings, and not as the actually expected type, Regex. * This caused each message passing through this MRF, if a rejected shortcode was set and the emoji did not exist already on the instance, to fail federating, as an exception was raised, swiftly caught and mostly silenced. * This commit fixes the issue by introducing new behavior: strings are now handled as perfect matches for an emoji shortcode (meaning that if the emoji-to-be-pulled's shortcode is in the blacklist, it will be rejected), while still supporting Regex types as before. --- .../web/activity_pub/mrf/steal_emoji_policy_test.exs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs b/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs index c537670f2..89d32352f 100644 --- a/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs +++ b/test/pleroma/web/activity_pub/mrf/steal_emoji_policy_test.exs @@ -60,7 +60,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicyTest do |> File.exists?() end - test "reject shortcode", %{message: message} do + test "reject regex shortcode", %{message: message} do refute "firedfox" in installed() clear_config(:mrf_steal_emoji, @@ -74,6 +74,20 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicyTest do refute "firedfox" in installed() end + test "reject string shortcode", %{message: message} do + refute "firedfox" in installed() + + clear_config(:mrf_steal_emoji, + hosts: ["example.org"], + size_limit: 284_468, + rejected_shortcodes: ["firedfox"] + ) + + assert {:ok, _message} = StealEmojiPolicy.filter(message) + + refute "firedfox" in installed() + end + test "reject if size is above the limit", %{message: message} do refute "firedfox" in installed() -- cgit v1.2.3 From 6f23fc8e08ae5a968cd9aa8dd8744e21ee9e3872 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Thu, 19 May 2022 02:12:55 +0200 Subject: Add tlsv1.3 to suggestions --- test/pleroma/config_db_test.exs | 5 +++-- test/pleroma/docs/generator_test.exs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/pleroma/config_db_test.exs b/test/pleroma/config_db_test.exs index ea44b716f..ba7c615e2 100644 --- a/test/pleroma/config_db_test.exs +++ b/test/pleroma/config_db_test.exs @@ -238,10 +238,11 @@ defmodule Pleroma.ConfigDBTest do end test "ssl options" do - assert ConfigDB.to_elixir_types([":tlsv1", ":tlsv1.1", ":tlsv1.2"]) == [ + assert ConfigDB.to_elixir_types([":tlsv1", ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]) == [ :tlsv1, :"tlsv1.1", - :"tlsv1.2" + :"tlsv1.2", + :"tlsv1.3" ] end diff --git a/test/pleroma/docs/generator_test.exs b/test/pleroma/docs/generator_test.exs index 92b4d13e4..5e41d6ccb 100644 --- a/test/pleroma/docs/generator_test.exs +++ b/test/pleroma/docs/generator_test.exs @@ -86,7 +86,7 @@ defmodule Pleroma.Docs.GeneratorTest do key: :versions, type: {:list, :atom}, description: "List of TLS version to use", - suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"] + suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"] } ] }, @@ -213,7 +213,7 @@ defmodule Pleroma.Docs.GeneratorTest do test "suggestion for tls versions" do [%{children: children} | _] = Generator.convert_to_strings(@descriptions) child = Enum.at(children, 8) - assert child[:suggestions] == [":tlsv1", ":tlsv1.1", ":tlsv1.2"] + assert child[:suggestions] == [":tlsv1", ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"] end test "subgroup with module name" do -- cgit v1.2.3 From b096fbba1a79d7ba6e429de2dfae2683d2d31001 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 2 Jun 2022 01:28:39 -0400 Subject: Fix long report notes giving errors on creation --- test/pleroma/report_note_test.exs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/pleroma/report_note_test.exs b/test/pleroma/report_note_test.exs index 136ad9a40..e2028a3ba 100644 --- a/test/pleroma/report_note_test.exs +++ b/test/pleroma/report_note_test.exs @@ -13,4 +13,27 @@ defmodule Pleroma.ReportNoteTest do assert {:ok, note} = ReportNote.create(user.id, report.id, "naughty boy") assert note.content == "naughty boy" end + + test "create/3 with very long content" do + user = insert(:user) + report = insert(:report_activity) + + very_long_content = """ + ] pwgen 25 15 + eJ9eeceiquoolei2queeLeimi aiN9ie2iokie8chush7aiph5N ulaNgaighoPiequaipuzoog8F + Ohphei0hee6hoo0wah4Aasah9 ziel3Yo3eew4neiy3ekiesh8u ue9ShahTh7oongoPheeneijah + ohGheeCh6aloque0Neviopou3 ush2oobohxeec4aequeich3Oo Ze3eighoowiojadohch8iCa1n + Yu4yieBie9eengoich8fae4th chohqu6exooSiibogh3iefeez peephahtaik9quie5mohD9nee + eeQuur3rie5mei8ieng6iesie wei1meinguv0Heidoov8Ibaed deemo2Poh6ohc3eiBeez1uox2 + ] pwgen 25 15 + eJ9eeceiquoolei2queeLeimi aiN9ie2iokie8chush7aiph5N ulaNgaighoPiequaipuzoog8F + Ohphei0hee6hoo0wah4Aasah9 ziel3Yo3eew4neiy3ekiesh8u ue9ShahTh7oongoPheeneijah + ohGheeCh6aloque0Neviopou3 ush2oobohxeec4aequeich3Oo Ze3eighoowiojadohch8iCa1n + Yu4yieBie9eengoich8fae4th chohqu6exooSiibogh3iefeez peephahtaik9quie5mohD9nee + eeQuur3rie5mei8ieng6iesie wei1meinguv0Heidoov8Ibaed deemo2Poh6ohc3eiBeez1uox2 + """ + + assert {:ok, note} = ReportNote.create(user.id, report.id, very_long_content) + assert note.content == very_long_content + end end -- cgit v1.2.3 From 11f9f2ef277937d5558a1cc0a92a60b872f17de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne?= Date: Tue, 28 Jun 2022 20:33:50 +0200 Subject: EmojiReactValidator: fix emoji qualification Tries fully-qualifying emoji when receiving them, by adding the emoji variation sequence to the received reaction emoji. This issue arises when other instance software, such as Misskey, tries reacting with emoji that have unqualified or minimally qualified variants, like a red heart. Pleroma only accepts fully qualified emoji in emoji reactions, and refused those emoji. Now, Pleroma will attempt to properly qualify them first, and reject them if checks still fail. --- test/fixtures/emoji-reaction-unqualified.json | 30 ++++++++++++++++++++++ .../transmogrifier/emoji_react_handling_test.exs | 26 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 test/fixtures/emoji-reaction-unqualified.json (limited to 'test') diff --git a/test/fixtures/emoji-reaction-unqualified.json b/test/fixtures/emoji-reaction-unqualified.json new file mode 100644 index 000000000..722fd7092 --- /dev/null +++ b/test/fixtures/emoji-reaction-unqualified.json @@ -0,0 +1,30 @@ +{ + "type": "EmojiReact", + "signature": { + "type": "RsaSignature2017", + "signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==", + "creator": "http://mastodon.example.org/users/admin#main-key", + "created": "2018-02-17T18:57:49Z" + }, + "object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454", + "content": "❤", + "nickname": "lain", + "id": "http://mastodon.example.org/users/admin#reactions/2", + "actor": "http://mastodon.example.org/users/admin", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "toot": "http://joinmastodon.org/ns#", + "sensitive": "as:sensitive", + "ostatus": "http://ostatus.org#", + "movedTo": "as:movedTo", + "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", + "inReplyToAtomUri": "ostatus:inReplyToAtomUri", + "conversation": "ostatus:conversation", + "atomUri": "ostatus:atomUri", + "Hashtag": "as:Hashtag", + "Emoji": "toot:Emoji" + } + ] +} diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index ceedb185f..5edb6d56e 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -37,6 +37,32 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do assert match?([["👌", _]], object.data["reactions"]) end + test "it works for incoming unqualified emoji reactions" do + user = insert(:user) + other_user = insert(:user, local: false) + {:ok, activity} = CommonAPI.post(user, %{status: "hello"}) + + data = + File.read!("test/fixtures/emoji-reaction-unqualified.json") + |> Jason.decode!() + |> Map.put("object", activity.data["object"]) + |> Map.put("actor", other_user.ap_id) + + {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + + assert data["actor"] == other_user.ap_id + assert data["type"] == "EmojiReact" + assert data["id"] == "http://mastodon.example.org/users/admin#reactions/2" + assert data["object"] == activity.data["object"] + # heart emoji with added emoji variation sequence + assert data["content"] == "❤️" + + object = Object.get_by_ap_id(data["object"]) + + assert object.data["reaction_count"] == 1 + assert match?([["❤️", _]], object.data["reactions"]) + end + test "it reject invalid emoji reactions" do user = insert(:user) other_user = insert(:user, local: false) -- cgit v1.2.3 From cd316d7269a6cac1e9edb732b202343001b82399 Mon Sep 17 00:00:00 2001 From: Ilja Date: Mon, 14 Feb 2022 13:14:25 +0100 Subject: Use EXIF data of image to prefill image description During attachment upload Pleroma returns a "description" field. Pleroma-fe has an MR to use that to pre-fill the image description field, * This MR allows Pleroma to read the EXIF data during upload and return the description to the FE * If a description is already present (e.g. because a previous module added it), it will use that * Otherwise it will read from the EXIF data. First it will check -ImageDescription, if that's empty, it will check -iptc:Caption-Abstract * If no description is found, it will simply return nil, just like before * When people set up a new instance, they will be asked if they want to read metadata and this module will be activated if so This was taken from an MR i did on Pleroma and isn't finished yet. --- .../portrait_of_owls_caption-abstract_tmp.jpg | Bin 0 -> 958147 bytes ...s_imagedescription_and_caption-abstract_tmp.jpg | Bin 0 -> 958193 bytes .../portrait_of_owls_no_description_tmp.jpg | Bin 0 -> 958065 bytes test/mix/tasks/pleroma/instance_test.exs | 7 +- .../upload/filter/exiftool_read_data_test.exs | 106 +++++++++++++++++++++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg create mode 100644 test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg create mode 100644 test/fixtures/portrait_of_owls_no_description_tmp.jpg create mode 100644 test/pleroma/upload/filter/exiftool_read_data_test.exs (limited to 'test') diff --git a/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg b/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg new file mode 100644 index 000000000..f5fe63999 Binary files /dev/null and b/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg differ diff --git a/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg b/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg new file mode 100644 index 000000000..0b8b85754 Binary files /dev/null and b/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg differ diff --git a/test/fixtures/portrait_of_owls_no_description_tmp.jpg b/test/fixtures/portrait_of_owls_no_description_tmp.jpg new file mode 100644 index 000000000..d63d40af8 Binary files /dev/null and b/test/fixtures/portrait_of_owls_no_description_tmp.jpg differ diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs index 249689ec6..e72aab701 100644 --- a/test/mix/tasks/pleroma/instance_test.exs +++ b/test/mix/tasks/pleroma/instance_test.exs @@ -69,6 +69,8 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do "./test/../test/instance/static/", "--strip-uploads", "y", + "--read-uploads-data", + "y", "--dedupe-uploads", "n", "--anonymize-uploads", @@ -91,7 +93,10 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do assert generated_config =~ "password: \"dbpass\"" assert generated_config =~ "configurable_from_database: true" assert generated_config =~ "http: [ip: {127, 0, 0, 1}, port: 4000]" - assert generated_config =~ "filters: [Pleroma.Upload.Filter.Exiftool]" + + assert generated_config =~ + "filters: [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.ExiftoolReadData]" + assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql() assert File.exists?(Path.expand("./test/instance/static/robots.txt")) end diff --git a/test/pleroma/upload/filter/exiftool_read_data_test.exs b/test/pleroma/upload/filter/exiftool_read_data_test.exs new file mode 100644 index 000000000..0861d293a --- /dev/null +++ b/test/pleroma/upload/filter/exiftool_read_data_test.exs @@ -0,0 +1,106 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Upload.Filter.ExiftoolReadDataTest do + use Pleroma.DataCase, async: true + alias Pleroma.Upload.Filter + + @uploads %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg"), + description: nil + } + + test "keeps description when not empty" do + uploads = %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname( + "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" + ), + description: "Eight different owls" + } + + assert Filter.ExiftoolReadData.filter(uploads) == + {:ok, :noop} + end + + test "otherwise returns ImageDescription when present" do + uploads_after = %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname( + "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" + ), + description: "Pictures of eight different owls" + } + + assert Filter.ExiftoolReadData.filter(@uploads) == + {:ok, :filtered, uploads_after} + end + + test "otherwise returns iptc:Caption-Abstract when present" do + upload = %Pleroma.Upload{ + name: "portrait_of_owls_caption-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), + description: nil + } + + upload_after = %Pleroma.Upload{ + name: "portrait_of_owls_caption-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), + description: "Pictures of eight different owls - iptc" + } + + assert Filter.ExiftoolReadData.filter(upload) == + {:ok, :filtered, upload_after} + end + + test "otherwise returns nil" do + uploads = %Pleroma.Upload{ + name: "portrait_of_owls_no_description-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_no_description.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_no_description_tmp.jpg"), + description: nil + } + + assert Filter.ExiftoolReadData.filter(uploads) == + {:ok, :filtered, uploads} + end + + test "Return nil when image description from EXIF data exceeds the maximum length" do + clear_config([:instance, :description_limit], 5) + + assert Filter.ExiftoolReadData.filter(@uploads) == + {:ok, :filtered, @uploads} + end + + test "Return nil when image description from EXIF data can't be read" do + uploads = %Pleroma.Upload{ + name: "non-existant.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/non-existant.jpg"), + tempfile: Path.absname("test/fixtures/non-existant_tmp.jpg"), + description: nil + } + + assert Filter.ExiftoolReadData.filter(uploads) == + {:ok, :filtered, uploads} + end +end -- cgit v1.2.3 From 551721e41a0bd98bb840baca48415a781cc463a7 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 20 Feb 2022 12:59:42 +0100 Subject: Rename the new module --- test/mix/tasks/pleroma/instance_test.exs | 4 +- .../upload/filter/exiftool/exiftool_test.exs | 42 ++++++++ .../filter/exiftool/read_description_test.exs | 106 +++++++++++++++++++++ .../upload/filter/exiftool_read_data_test.exs | 106 --------------------- test/pleroma/upload/filter/exiftool_test.exs | 42 -------- 5 files changed, 150 insertions(+), 150 deletions(-) create mode 100644 test/pleroma/upload/filter/exiftool/exiftool_test.exs create mode 100644 test/pleroma/upload/filter/exiftool/read_description_test.exs delete mode 100644 test/pleroma/upload/filter/exiftool_read_data_test.exs delete mode 100644 test/pleroma/upload/filter/exiftool_test.exs (limited to 'test') diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs index e72aab701..265b679f7 100644 --- a/test/mix/tasks/pleroma/instance_test.exs +++ b/test/mix/tasks/pleroma/instance_test.exs @@ -69,7 +69,7 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do "./test/../test/instance/static/", "--strip-uploads", "y", - "--read-uploads-data", + "--read-uploads-description", "y", "--dedupe-uploads", "n", @@ -95,7 +95,7 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do assert generated_config =~ "http: [ip: {127, 0, 0, 1}, port: 4000]" assert generated_config =~ - "filters: [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.ExiftoolReadData]" + "filters: [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.Exiftool.ReadDescription]" assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql() assert File.exists?(Path.expand("./test/instance/static/robots.txt")) diff --git a/test/pleroma/upload/filter/exiftool/exiftool_test.exs b/test/pleroma/upload/filter/exiftool/exiftool_test.exs new file mode 100644 index 000000000..0a0ef2bdf --- /dev/null +++ b/test/pleroma/upload/filter/exiftool/exiftool_test.exs @@ -0,0 +1,42 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Upload.Filter.ExiftoolTest do + use Pleroma.DataCase, async: true + alias Pleroma.Upload.Filter + + test "apply exiftool filter" do + assert Pleroma.Utils.command_available?("exiftool") + + File.cp!( + "test/fixtures/DSCN0010.jpg", + "test/fixtures/DSCN0010_tmp.jpg" + ) + + upload = %Pleroma.Upload{ + name: "image_with_GPS_data.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/DSCN0010.jpg"), + tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg") + } + + assert Filter.Exiftool.filter(upload) == {:ok, :filtered} + + {exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"]) + {exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"]) + + refute exif_original == exif_filtered + assert String.match?(exif_original, ~r/GPS/) + refute String.match?(exif_filtered, ~r/GPS/) + end + + test "verify webp files are skipped" do + upload = %Pleroma.Upload{ + name: "sample.webp", + content_type: "image/webp" + } + + assert Filter.Exiftool.filter(upload) == {:ok, :noop} + end +end diff --git a/test/pleroma/upload/filter/exiftool/read_description_test.exs b/test/pleroma/upload/filter/exiftool/read_description_test.exs new file mode 100644 index 000000000..0e97b424b --- /dev/null +++ b/test/pleroma/upload/filter/exiftool/read_description_test.exs @@ -0,0 +1,106 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do + use Pleroma.DataCase, async: true + alias Pleroma.Upload.Filter + + @uploads %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg"), + description: nil + } + + test "keeps description when not empty" do + uploads = %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname( + "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" + ), + description: "Eight different owls" + } + + assert Filter.Exiftool.ReadDescription.filter(uploads) == + {:ok, :noop} + end + + test "otherwise returns ImageDescription when present" do + uploads_after = %Pleroma.Upload{ + name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + content_type: "image/jpeg", + path: + Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + tempfile: + Path.absname( + "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" + ), + description: "Pictures of eight different owls" + } + + assert Filter.Exiftool.ReadDescription.filter(@uploads) == + {:ok, :filtered, uploads_after} + end + + test "otherwise returns iptc:Caption-Abstract when present" do + upload = %Pleroma.Upload{ + name: "portrait_of_owls_caption-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), + description: nil + } + + upload_after = %Pleroma.Upload{ + name: "portrait_of_owls_caption-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), + description: "Pictures of eight different owls - iptc" + } + + assert Filter.Exiftool.ReadDescription.filter(upload) == + {:ok, :filtered, upload_after} + end + + test "otherwise returns nil" do + uploads = %Pleroma.Upload{ + name: "portrait_of_owls_no_description-abstract.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/portrait_of_owls_no_description.jpg"), + tempfile: Path.absname("test/fixtures/portrait_of_owls_no_description_tmp.jpg"), + description: nil + } + + assert Filter.Exiftool.ReadDescription.filter(uploads) == + {:ok, :filtered, uploads} + end + + test "Return nil when image description from EXIF data exceeds the maximum length" do + clear_config([:instance, :description_limit], 5) + + assert Filter.Exiftool.ReadDescription.filter(@uploads) == + {:ok, :filtered, @uploads} + end + + test "Return nil when image description from EXIF data can't be read" do + uploads = %Pleroma.Upload{ + name: "non-existant.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/non-existant.jpg"), + tempfile: Path.absname("test/fixtures/non-existant_tmp.jpg"), + description: nil + } + + assert Filter.Exiftool.ReadDescription.filter(uploads) == + {:ok, :filtered, uploads} + end +end diff --git a/test/pleroma/upload/filter/exiftool_read_data_test.exs b/test/pleroma/upload/filter/exiftool_read_data_test.exs deleted file mode 100644 index 0861d293a..000000000 --- a/test/pleroma/upload/filter/exiftool_read_data_test.exs +++ /dev/null @@ -1,106 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2021 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Upload.Filter.ExiftoolReadDataTest do - use Pleroma.DataCase, async: true - alias Pleroma.Upload.Filter - - @uploads %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", - content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), - tempfile: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg"), - description: nil - } - - test "keeps description when not empty" do - uploads = %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", - content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), - tempfile: - Path.absname( - "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" - ), - description: "Eight different owls" - } - - assert Filter.ExiftoolReadData.filter(uploads) == - {:ok, :noop} - end - - test "otherwise returns ImageDescription when present" do - uploads_after = %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", - content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), - tempfile: - Path.absname( - "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" - ), - description: "Pictures of eight different owls" - } - - assert Filter.ExiftoolReadData.filter(@uploads) == - {:ok, :filtered, uploads_after} - end - - test "otherwise returns iptc:Caption-Abstract when present" do - upload = %Pleroma.Upload{ - name: "portrait_of_owls_caption-abstract.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), - description: nil - } - - upload_after = %Pleroma.Upload{ - name: "portrait_of_owls_caption-abstract.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), - description: "Pictures of eight different owls - iptc" - } - - assert Filter.ExiftoolReadData.filter(upload) == - {:ok, :filtered, upload_after} - end - - test "otherwise returns nil" do - uploads = %Pleroma.Upload{ - name: "portrait_of_owls_no_description-abstract.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_no_description.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_no_description_tmp.jpg"), - description: nil - } - - assert Filter.ExiftoolReadData.filter(uploads) == - {:ok, :filtered, uploads} - end - - test "Return nil when image description from EXIF data exceeds the maximum length" do - clear_config([:instance, :description_limit], 5) - - assert Filter.ExiftoolReadData.filter(@uploads) == - {:ok, :filtered, @uploads} - end - - test "Return nil when image description from EXIF data can't be read" do - uploads = %Pleroma.Upload{ - name: "non-existant.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/non-existant.jpg"), - tempfile: Path.absname("test/fixtures/non-existant_tmp.jpg"), - description: nil - } - - assert Filter.ExiftoolReadData.filter(uploads) == - {:ok, :filtered, uploads} - end -end diff --git a/test/pleroma/upload/filter/exiftool_test.exs b/test/pleroma/upload/filter/exiftool_test.exs deleted file mode 100644 index 0a0ef2bdf..000000000 --- a/test/pleroma/upload/filter/exiftool_test.exs +++ /dev/null @@ -1,42 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Upload.Filter.ExiftoolTest do - use Pleroma.DataCase, async: true - alias Pleroma.Upload.Filter - - test "apply exiftool filter" do - assert Pleroma.Utils.command_available?("exiftool") - - File.cp!( - "test/fixtures/DSCN0010.jpg", - "test/fixtures/DSCN0010_tmp.jpg" - ) - - upload = %Pleroma.Upload{ - name: "image_with_GPS_data.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/DSCN0010.jpg"), - tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg") - } - - assert Filter.Exiftool.filter(upload) == {:ok, :filtered} - - {exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"]) - {exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"]) - - refute exif_original == exif_filtered - assert String.match?(exif_original, ~r/GPS/) - refute String.match?(exif_filtered, ~r/GPS/) - end - - test "verify webp files are skipped" do - upload = %Pleroma.Upload{ - name: "sample.webp", - content_type: "image/webp" - } - - assert Filter.Exiftool.filter(upload) == {:ok, :noop} - end -end -- cgit v1.2.3 From 8303af84ce818b57347db4cd12611c4dd45bdf95 Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 20 Feb 2022 13:46:29 +0100 Subject: Rename the Exiftool module No migrations or checks yet --- test/mix/tasks/pleroma/instance_test.exs | 4 +-- .../upload/filter/exiftool/exiftool_test.exs | 42 ---------------------- .../upload/filter/exiftool/strip_location_test.exs | 42 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 test/pleroma/upload/filter/exiftool/exiftool_test.exs create mode 100644 test/pleroma/upload/filter/exiftool/strip_location_test.exs (limited to 'test') diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs index 265b679f7..b1c10e03c 100644 --- a/test/mix/tasks/pleroma/instance_test.exs +++ b/test/mix/tasks/pleroma/instance_test.exs @@ -67,7 +67,7 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do "test/uploads", "--static-dir", "./test/../test/instance/static/", - "--strip-uploads", + "--strip-uploads-location", "y", "--read-uploads-description", "y", @@ -95,7 +95,7 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do assert generated_config =~ "http: [ip: {127, 0, 0, 1}, port: 4000]" assert generated_config =~ - "filters: [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.Exiftool.ReadDescription]" + "filters: [Pleroma.Upload.Filter.Exiftool.StripLocation, Pleroma.Upload.Filter.Exiftool.ReadDescription]" assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql() assert File.exists?(Path.expand("./test/instance/static/robots.txt")) diff --git a/test/pleroma/upload/filter/exiftool/exiftool_test.exs b/test/pleroma/upload/filter/exiftool/exiftool_test.exs deleted file mode 100644 index 0a0ef2bdf..000000000 --- a/test/pleroma/upload/filter/exiftool/exiftool_test.exs +++ /dev/null @@ -1,42 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Upload.Filter.ExiftoolTest do - use Pleroma.DataCase, async: true - alias Pleroma.Upload.Filter - - test "apply exiftool filter" do - assert Pleroma.Utils.command_available?("exiftool") - - File.cp!( - "test/fixtures/DSCN0010.jpg", - "test/fixtures/DSCN0010_tmp.jpg" - ) - - upload = %Pleroma.Upload{ - name: "image_with_GPS_data.jpg", - content_type: "image/jpeg", - path: Path.absname("test/fixtures/DSCN0010.jpg"), - tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg") - } - - assert Filter.Exiftool.filter(upload) == {:ok, :filtered} - - {exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"]) - {exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"]) - - refute exif_original == exif_filtered - assert String.match?(exif_original, ~r/GPS/) - refute String.match?(exif_filtered, ~r/GPS/) - end - - test "verify webp files are skipped" do - upload = %Pleroma.Upload{ - name: "sample.webp", - content_type: "image/webp" - } - - assert Filter.Exiftool.filter(upload) == {:ok, :noop} - end -end diff --git a/test/pleroma/upload/filter/exiftool/strip_location_test.exs b/test/pleroma/upload/filter/exiftool/strip_location_test.exs new file mode 100644 index 000000000..7e1541f60 --- /dev/null +++ b/test/pleroma/upload/filter/exiftool/strip_location_test.exs @@ -0,0 +1,42 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Upload.Filter.Exiftool.StripLocationTest do + use Pleroma.DataCase, async: true + alias Pleroma.Upload.Filter + + test "apply exiftool filter" do + assert Pleroma.Utils.command_available?("exiftool") + + File.cp!( + "test/fixtures/DSCN0010.jpg", + "test/fixtures/DSCN0010_tmp.jpg" + ) + + upload = %Pleroma.Upload{ + name: "image_with_GPS_data.jpg", + content_type: "image/jpeg", + path: Path.absname("test/fixtures/DSCN0010.jpg"), + tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg") + } + + assert Filter.Exiftool.StripLocation.filter(upload) == {:ok, :filtered} + + {exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"]) + {exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"]) + + refute exif_original == exif_filtered + assert String.match?(exif_original, ~r/GPS/) + refute String.match?(exif_filtered, ~r/GPS/) + end + + test "verify webp files are skipped" do + upload = %Pleroma.Upload{ + name: "sample.webp", + content_type: "image/webp" + } + + assert Filter.Exiftool.StripLocation.filter(upload) == {:ok, :noop} + end +end -- cgit v1.2.3 From d0d48a9e8832ed81e67126a2af019981cb761a2b Mon Sep 17 00:00:00 2001 From: Ilja Date: Sun, 20 Feb 2022 14:46:37 +0100 Subject: Add deprecation warnings --- test/pleroma/config/deprecation_warnings_test.exs | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'test') diff --git a/test/pleroma/config/deprecation_warnings_test.exs b/test/pleroma/config/deprecation_warnings_test.exs index 202ec4b90..ffd446909 100644 --- a/test/pleroma/config/deprecation_warnings_test.exs +++ b/test/pleroma/config/deprecation_warnings_test.exs @@ -11,6 +11,62 @@ defmodule Pleroma.Config.DeprecationWarningsTest do alias Pleroma.Config alias Pleroma.Config.DeprecationWarnings + describe "filter exiftool" do + test "gives warning when still used" do + clear_config( + [Pleroma.Upload, :filters], + [Pleroma.Upload.Filter.Exiftool] + ) + + assert capture_log(fn -> DeprecationWarnings.check_exiftool_filter() end) =~ + """ + !!!DEPRECATION WARNING!!! + Your config is using Exiftool as a filter instead of Exiftool.StripLocation. This should work for now, but you are advised to change to the new configuration to prevent possible issues later: + + ``` + config :pleroma, Pleroma.Upload, + filters: [Pleroma.Upload.Filter.Exiftool] + ``` + + Is now + + + ``` + config :pleroma, Pleroma.Upload, + filters: [Pleroma.Upload.Filter.Exiftool.StripLocation] + ``` + """ + end + + test "changes setting to exiftool strip location" do + clear_config( + [Pleroma.Upload, :filters], + [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.Exiftool.ReadDescription] + ) + + expected_config = [ + Pleroma.Upload.Filter.Exiftool.StripLocation, + Pleroma.Upload.Filter.Exiftool.ReadDescription + ] + + capture_log(fn -> DeprecationWarnings.warn() end) + + assert Config.get([Pleroma.Upload])[:filters] == expected_config + end + + test "doesn't give a warning with correct config" do + clear_config( + [Pleroma.Upload, :filters], + [ + Pleroma.Upload.Filter.Exiftool.StripLocation, + Pleroma.Upload.Filter.Exiftool.ReadDescription + ] + ) + + assert capture_log(fn -> DeprecationWarnings.check_exiftool_filter() end) == "" + end + end + describe "simple policy tuples" do test "gives warning when there are still strings" do clear_config([:mrf_simple], -- cgit v1.2.3 From 81afaee37436f1802f4e0a6d33d9bb8121e51f48 Mon Sep 17 00:00:00 2001 From: Ilja Date: Tue, 22 Feb 2022 18:18:10 +0100 Subject: Better way of getting keys I used keyword_list[:key], but if the key doesn't exist, it will return nil. I actually expect a list and further down the code I use that list. I believe the key should always be present, but in case it's not, it's better to return an empty list instead of nil. That way the code wont fail further down the line. --- test/pleroma/config/deprecation_warnings_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/pleroma/config/deprecation_warnings_test.exs b/test/pleroma/config/deprecation_warnings_test.exs index ffd446909..f3453ddb0 100644 --- a/test/pleroma/config/deprecation_warnings_test.exs +++ b/test/pleroma/config/deprecation_warnings_test.exs @@ -51,7 +51,7 @@ defmodule Pleroma.Config.DeprecationWarningsTest do capture_log(fn -> DeprecationWarnings.warn() end) - assert Config.get([Pleroma.Upload])[:filters] == expected_config + assert Config.get([Pleroma.Upload]) |> Keyword.get(:filters, []) == expected_config end test "doesn't give a warning with correct config" do -- cgit v1.2.3 From 4a9ed319b8916500bcb7b8e7c319fea9acdf95dc Mon Sep 17 00:00:00 2001 From: Ilja Date: Sat, 21 May 2022 09:37:20 +0200 Subject: Change test pictures The previous pictures were labeled as public domain, but are actually a collage of pictures under other licenses. I now replaced them with a jpeg of simply a white pixel. --- test/fixtures/image_with_caption-abstract.jpg | Bin 0 -> 697 bytes ..._with_imagedescription_and_caption-abstract.jpg | Bin 0 -> 823 bytes test/fixtures/image_with_no_description.jpg | Bin 0 -> 631 bytes .../portrait_of_owls_caption-abstract_tmp.jpg | Bin 958147 -> 0 bytes ...s_imagedescription_and_caption-abstract_tmp.jpg | Bin 958193 -> 0 bytes .../portrait_of_owls_no_description_tmp.jpg | Bin 958065 -> 0 bytes .../filter/exiftool/read_description_test.exs | 50 +++++++++------------ 7 files changed, 21 insertions(+), 29 deletions(-) create mode 100644 test/fixtures/image_with_caption-abstract.jpg create mode 100644 test/fixtures/image_with_imagedescription_and_caption-abstract.jpg create mode 100644 test/fixtures/image_with_no_description.jpg delete mode 100644 test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg delete mode 100644 test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg delete mode 100644 test/fixtures/portrait_of_owls_no_description_tmp.jpg (limited to 'test') diff --git a/test/fixtures/image_with_caption-abstract.jpg b/test/fixtures/image_with_caption-abstract.jpg new file mode 100644 index 000000000..f982ffa81 Binary files /dev/null and b/test/fixtures/image_with_caption-abstract.jpg differ diff --git a/test/fixtures/image_with_imagedescription_and_caption-abstract.jpg b/test/fixtures/image_with_imagedescription_and_caption-abstract.jpg new file mode 100644 index 000000000..c82a269ef Binary files /dev/null and b/test/fixtures/image_with_imagedescription_and_caption-abstract.jpg differ diff --git a/test/fixtures/image_with_no_description.jpg b/test/fixtures/image_with_no_description.jpg new file mode 100644 index 000000000..ec6fc4be8 Binary files /dev/null and b/test/fixtures/image_with_no_description.jpg differ diff --git a/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg b/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg deleted file mode 100644 index f5fe63999..000000000 Binary files a/test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg and /dev/null differ diff --git a/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg b/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg deleted file mode 100644 index 0b8b85754..000000000 Binary files a/test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg and /dev/null differ diff --git a/test/fixtures/portrait_of_owls_no_description_tmp.jpg b/test/fixtures/portrait_of_owls_no_description_tmp.jpg deleted file mode 100644 index d63d40af8..000000000 Binary files a/test/fixtures/portrait_of_owls_no_description_tmp.jpg and /dev/null differ diff --git a/test/pleroma/upload/filter/exiftool/read_description_test.exs b/test/pleroma/upload/filter/exiftool/read_description_test.exs index 0e97b424b..0b358215c 100644 --- a/test/pleroma/upload/filter/exiftool/read_description_test.exs +++ b/test/pleroma/upload/filter/exiftool/read_description_test.exs @@ -7,26 +7,21 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do alias Pleroma.Upload.Filter @uploads %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + name: "image_with_imagedescription_and_caption-abstract.jpg", content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), - tempfile: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg"), + path: Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), description: nil } test "keeps description when not empty" do uploads = %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + name: "image_with_imagedescription_and_caption-abstract.jpg", content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + path: Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), tempfile: - Path.absname( - "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" - ), - description: "Eight different owls" + Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), + description: "Some description" } assert Filter.Exiftool.ReadDescription.filter(uploads) == @@ -35,15 +30,12 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do test "otherwise returns ImageDescription when present" do uploads_after = %Pleroma.Upload{ - name: "portrait_of_owls_imagedescription_and_caption-abstract.jpg", + name: "image_with_imagedescription_and_caption-abstract.jpg", content_type: "image/jpeg", - path: - Path.absname("test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract.jpg"), + path: Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), tempfile: - Path.absname( - "test/fixtures/portrait_of_owls_imagedescription_and_caption-abstract_tmp.jpg" - ), - description: "Pictures of eight different owls" + Path.absname("test/fixtures/image_with_imagedescription_and_caption-abstract.jpg"), + description: "a descriptive white pixel" } assert Filter.Exiftool.ReadDescription.filter(@uploads) == @@ -52,19 +44,19 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do test "otherwise returns iptc:Caption-Abstract when present" do upload = %Pleroma.Upload{ - name: "portrait_of_owls_caption-abstract.jpg", + name: "image_with_caption-abstract.jpg", content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), + path: Path.absname("test/fixtures/image_with_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/image_with_caption-abstract.jpg"), description: nil } upload_after = %Pleroma.Upload{ - name: "portrait_of_owls_caption-abstract.jpg", + name: "image_with_caption-abstract.jpg", content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_caption-abstract.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_caption-abstract_tmp.jpg"), - description: "Pictures of eight different owls - iptc" + path: Path.absname("test/fixtures/image_with_caption-abstract.jpg"), + tempfile: Path.absname("test/fixtures/image_with_caption-abstract.jpg"), + description: "an abstract white pixel" } assert Filter.Exiftool.ReadDescription.filter(upload) == @@ -73,10 +65,10 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do test "otherwise returns nil" do uploads = %Pleroma.Upload{ - name: "portrait_of_owls_no_description-abstract.jpg", + name: "image_with_no_description.jpg", content_type: "image/jpeg", - path: Path.absname("test/fixtures/portrait_of_owls_no_description.jpg"), - tempfile: Path.absname("test/fixtures/portrait_of_owls_no_description_tmp.jpg"), + path: Path.absname("test/fixtures/image_with_no_description.jpg"), + tempfile: Path.absname("test/fixtures/image_with_no_description.jpg"), description: nil } -- cgit v1.2.3 From 56227ef7ba097c6be39a7e70b67c426a3016e0ab Mon Sep 17 00:00:00 2001 From: Ilja Date: Fri, 1 Jul 2022 12:31:34 +0200 Subject: Descriptions from exif data with only whitespeces are considered empty I noticed that pictures taken with Ubuntu-Touch have whitespace in one of the fields This should just be ignored imo --- ...edescription_and_caption-abstract_whitespaces.jpg | Bin 0 -> 785 bytes .../upload/filter/exiftool/read_description_test.exs | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg (limited to 'test') diff --git a/test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg b/test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg new file mode 100644 index 000000000..a232fd2a1 Binary files /dev/null and b/test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg differ diff --git a/test/pleroma/upload/filter/exiftool/read_description_test.exs b/test/pleroma/upload/filter/exiftool/read_description_test.exs index 0b358215c..7389fda47 100644 --- a/test/pleroma/upload/filter/exiftool/read_description_test.exs +++ b/test/pleroma/upload/filter/exiftool/read_description_test.exs @@ -83,6 +83,25 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do {:ok, :filtered, @uploads} end + test "Ignores content with only whitespace" do + uploads = %Pleroma.Upload{ + name: "non-existant.jpg", + content_type: "image/jpeg", + path: + Path.absname( + "test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg" + ), + tempfile: + Path.absname( + "test/fixtures/image_with_imagedescription_and_caption-abstract_whitespaces.jpg" + ), + description: nil + } + + assert Filter.Exiftool.ReadDescription.filter(uploads) == + {:ok, :filtered, uploads} + end + test "Return nil when image description from EXIF data can't be read" do uploads = %Pleroma.Upload{ name: "non-existant.jpg", -- cgit v1.2.3 From 8c78fef56faff58b3ca291c2d25957b672f84bbe Mon Sep 17 00:00:00 2001 From: Haelwenn Date: Mon, 4 Jul 2022 00:25:54 +0000 Subject: EmojiReactValidator: apply lanodan's suggestions These changes make the encoding for the fully-qualified heart emoji very visible in editors. --- .../web/activity_pub/transmogrifier/emoji_react_handling_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index 5edb6d56e..41d96fa66 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -55,12 +55,12 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do assert data["id"] == "http://mastodon.example.org/users/admin#reactions/2" assert data["object"] == activity.data["object"] # heart emoji with added emoji variation sequence - assert data["content"] == "❤️" + assert data["content"] == "❤\uFE0F" object = Object.get_by_ap_id(data["object"]) assert object.data["reaction_count"] == 1 - assert match?([["❤️", _]], object.data["reactions"]) + assert match?([["❤\uFE0F", _]], object.data["reactions"]) end test "it reject invalid emoji reactions" do -- cgit v1.2.3 From 0d4aceb9b0c6d742b481c08b88ba50d67c65c091 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 5 Jul 2022 20:36:47 -0600 Subject: Make checking blacklisted domains and restricted nicknames case-insenstive --- test/pleroma/user_test.exs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 884b846ae..5b513f01b 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -618,6 +618,7 @@ defmodule Pleroma.UserTest do end test "it restricts certain nicknames" do + clear_config([User, :restricted_nicknames], ["about"]) [restricted_name | _] = Pleroma.Config.get([User, :restricted_nicknames]) assert is_bitstring(restricted_name) @@ -631,6 +632,23 @@ defmodule Pleroma.UserTest do refute changeset.valid? end + test "it is case-insensitive when restricting nicknames" do + clear_config([User, :restricted_nicknames], ["about"]) + [restricted_name | _] = Pleroma.Config.get([User, :restricted_nicknames]) + + assert is_bitstring(restricted_name) + + restricted_upcase_name = String.upcase(restricted_name) + + params = + @full_user_data + |> Map.put(:nickname, restricted_upcase_name) + + changeset = User.register_changeset(%User{}, params) + + refute changeset.valid? + end + test "it blocks blacklisted email domains" do clear_config([User, :email_blacklist], ["trolling.world"]) @@ -639,6 +657,11 @@ defmodule Pleroma.UserTest do changeset = User.register_changeset(%User{}, params) refute changeset.valid? + # Block with case-insensitive match + params = Map.put(@full_user_data, :email, "troll@TrOlLing.wOrld") + changeset = User.register_changeset(%User{}, params) + refute changeset.valid? + # Block with subdomain match params = Map.put(@full_user_data, :email, "troll@gnomes.trolling.world") changeset = User.register_changeset(%User{}, params) -- cgit v1.2.3 From 0b16ce79f91c0f7c99cf11567e29b1adb139ff35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Fri, 8 Jul 2022 20:54:12 +0200 Subject: Add test for rendering mute expiration date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../web/mastodon_api/views/account_view_test.exs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 8ed37fe58..cc45ce4e9 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -634,4 +634,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do |> assert() end end + + test "renders mute expiration date" do + user = insert(:user) + other_user = insert(:user) + + {:ok, _user_relationships} = + User.mute(user, other_user, %{notifications: true, expires_in: 24 * 60 * 60}) + + %{ + mute_expires_at: mute_expires_at + } = AccountView.render("show.json", %{user: other_user, for: user, mutes: true}) + + assert NaiveDateTime.diff( + mute_expires_at, + NaiveDateTime.utc_now() |> NaiveDateTime.add(24 * 60 * 60) + ) in -3..3 + end end -- cgit v1.2.3 From 2efc0ffcf0beea2f65e1c2b0857da9d6739eee8e Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sun, 10 Jul 2022 00:10:35 -0400 Subject: Pass remote follow avatar into media proxy --- .../twitter_api/remote_follow_controller_test.exs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs index fa3b29006..97c9c6b1d 100644 --- a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs +++ b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs @@ -410,4 +410,49 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do assert response =~ "Error following account" end end + + describe "avatar url" do + test "without media proxy" do + clear_config([:media_proxy, :enabled], false) + + user = + insert(:user, %{ + local: false, + avatar: %{"url" => [%{"href" => "https://remote.org/avatar.png"}]} + }) + + avatar_url = Pleroma.Web.TwitterAPI.RemoteFollowView.avatar_url(user) + + assert avatar_url == "https://remote.org/avatar.png" + end + + test "with media proxy" do + clear_config([:media_proxy, :enabled], true) + + user = + insert(:user, %{ + local: false, + avatar: %{"url" => [%{"href" => "https://remote.org/avatar.png"}]} + }) + + avatar_url = Pleroma.Web.TwitterAPI.RemoteFollowView.avatar_url(user) + url = Pleroma.Web.Endpoint.url() + + assert String.starts_with?(avatar_url, url) + end + + test "local avatar is not proxied" do + clear_config([:media_proxy, :enabled], true) + + user = + insert(:user, %{ + local: true, + avatar: %{"url" => [%{"href" => "#{Pleroma.Web.Endpoint.url()}/localuser/avatar.png"}]} + }) + + avatar_url = Pleroma.Web.TwitterAPI.RemoteFollowView.avatar_url(user) + + assert avatar_url == "#{Pleroma.Web.Endpoint.url()}/localuser/avatar.png" + end + end end -- cgit v1.2.3 From 3cf6c2b7ea20c9c87c63e382c36231b1b9be3d7f Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 9 Jul 2022 23:39:35 -0600 Subject: Use is_binary instead of is_bitstring for restricted nicknames tests --- test/pleroma/user_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 5b513f01b..408389c3a 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -621,7 +621,7 @@ defmodule Pleroma.UserTest do clear_config([User, :restricted_nicknames], ["about"]) [restricted_name | _] = Pleroma.Config.get([User, :restricted_nicknames]) - assert is_bitstring(restricted_name) + assert is_binary(restricted_name) params = @full_user_data @@ -636,7 +636,7 @@ defmodule Pleroma.UserTest do clear_config([User, :restricted_nicknames], ["about"]) [restricted_name | _] = Pleroma.Config.get([User, :restricted_nicknames]) - assert is_bitstring(restricted_name) + assert is_binary(restricted_name) restricted_upcase_name = String.upcase(restricted_name) -- cgit v1.2.3 From c1874bc8f943599383fe0a03f129d3113c1cf301 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Tue, 12 Jul 2022 19:03:18 -0400 Subject: Make mutes and blocks behave the same as other lists --- .../controllers/account_controller_test.exs | 44 +++++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index effa2144f..ee9db4288 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -1829,21 +1829,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/mutes") |> json_response_and_validate_schema(200) - assert [id1, id2, id3] == Enum.map(result, & &1["id"]) + assert [id3, id2, id1] == Enum.map(result, & &1["id"]) result = conn |> get("/api/v1/mutes?limit=1") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id1}] = result + assert [%{"id" => ^id3}] = result result = conn |> get("/api/v1/mutes?since_id=#{id1}") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id2}, %{"id" => ^id3}] = result + assert [%{"id" => ^id3}, %{"id" => ^id2}] = result result = conn @@ -1857,7 +1857,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/mutes?since_id=#{id1}&limit=1") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id2}] = result + assert [%{"id" => ^id3}] = result end test "list of mutes with with_relationships parameter" do @@ -1876,7 +1876,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert [ %{ - "id" => ^id1, + "id" => ^id3, "pleroma" => %{"relationship" => %{"muting" => true, "followed_by" => true}} }, %{ @@ -1884,7 +1884,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do "pleroma" => %{"relationship" => %{"muting" => true, "followed_by" => true}} }, %{ - "id" => ^id3, + "id" => ^id1, "pleroma" => %{"relationship" => %{"muting" => true, "followed_by" => true}} } ] = @@ -1909,7 +1909,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/blocks") |> json_response_and_validate_schema(200) - assert [id1, id2, id3] == Enum.map(result, & &1["id"]) + assert [id3, id2, id1] == Enum.map(result, & &1["id"]) result = conn @@ -1917,7 +1917,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/blocks?limit=1") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id1}] = result + assert [%{"id" => ^id3}] = result result = conn @@ -1925,7 +1925,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/blocks?since_id=#{id1}") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id2}, %{"id" => ^id3}] = result + assert [%{"id" => ^id3}, %{"id" => ^id2}] = result result = conn @@ -1941,7 +1941,31 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do |> get("/api/v1/blocks?since_id=#{id1}&limit=1") |> json_response_and_validate_schema(200) - assert [%{"id" => ^id2}] = result + assert [%{"id" => ^id3}] = result + + conn_res = + conn + |> assign(:user, user) + |> get("/api/v1/blocks?limit=2") + + next_url = + ~r{<.+?(?/api[^>]+)>; rel=\"next\"} + |> Regex.named_captures(get_resp_header(conn_res, "link") |> Enum.at(0)) + |> Map.get("link") + + result = + conn_res + |> json_response_and_validate_schema(200) + + assert [%{"id" => ^id3}, %{"id" => ^id2}] = result + + result = + conn + |> assign(:user, user) + |> get(next_url) + |> json_response_and_validate_schema(200) + + assert [%{"id" => ^id1}] = result end test "account lookup", %{conn: conn} do -- cgit v1.2.3 From eb2a1652bf3676de955a2912a42d50aa068131fa Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 13 Jul 2022 00:40:46 -0400 Subject: Add tests for short_description --- test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs index 9845408d6..13e3ffc0a 100644 --- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs @@ -22,6 +22,7 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do "uri" => _, "title" => _, "description" => _, + "short_description" => _, "version" => _, "email" => from_config_email, "urls" => %{ -- cgit v1.2.3 From 36f6d92d987ccfcd3139f090efb449fb3c2f79d7 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Wed, 13 Jul 2022 18:08:33 -0400 Subject: Add tests for translator compiler --- test/pleroma/docs/translator/compiler_test.exs | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/pleroma/docs/translator/compiler_test.exs (limited to 'test') diff --git a/test/pleroma/docs/translator/compiler_test.exs b/test/pleroma/docs/translator/compiler_test.exs new file mode 100644 index 000000000..66bb77dc1 --- /dev/null +++ b/test/pleroma/docs/translator/compiler_test.exs @@ -0,0 +1,55 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Docs.Translator.CompilerTest do + use ExUnit.Case, async: true + + alias Pleroma.Docs.Translator.Compiler + + @descriptions [ + %{ + label: "1", + description: "2", + children: [ + %{ + label: "3", + description: "4" + }, + %{ + label: "5", + description: "6" + } + ] + }, + %{ + label: "7", + description: "8", + children: [ + %{ + description: "9", + children: [ + %{ + description: "10", + children: [ + %{description: "11"}, + %{description: "12"} + ] + } + ] + }, + %{ + label: "13" + } + ] + } + ] + + describe "extract_strings/1" do + test "it extracts all labels and descriptions" do + strings = Compiler.extract_strings(@descriptions) + assert length(strings) == 13 + assert Enum.all?(1..13, &(to_string(&1) in strings)) + end + end +end -- cgit v1.2.3 From 1d7e8d6e013bb39e6ca61bd595a22490412db084 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Thu, 14 Jul 2022 17:41:33 -0400 Subject: Pass in msgctxt for config translation strings --- test/pleroma/docs/translator/compiler_test.exs | 41 ++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/pleroma/docs/translator/compiler_test.exs b/test/pleroma/docs/translator/compiler_test.exs index 66bb77dc1..d6c3cdd40 100644 --- a/test/pleroma/docs/translator/compiler_test.exs +++ b/test/pleroma/docs/translator/compiler_test.exs @@ -9,30 +9,36 @@ defmodule Pleroma.Docs.Translator.CompilerTest do @descriptions [ %{ + key: "1", label: "1", description: "2", children: [ %{ + key: "3", label: "3", description: "4" }, %{ + key: "5", label: "5", description: "6" } ] }, %{ + key: "7", label: "7", description: "8", children: [ %{ + key: "9", description: "9", children: [ %{ + key: "10", description: "10", children: [ - %{description: "11"}, + %{key: "11", description: "11"}, %{description: "12"} ] } @@ -42,14 +48,43 @@ defmodule Pleroma.Docs.Translator.CompilerTest do label: "13" } ] + }, + %{ + group: "14", + label: "14" + }, + %{ + group: "15", + key: "15", + label: "15" + }, + %{ + group: {":subgroup", "16"}, + label: "16" } ] describe "extract_strings/1" do test "it extracts all labels and descriptions" do strings = Compiler.extract_strings(@descriptions) - assert length(strings) == 13 - assert Enum.all?(1..13, &(to_string(&1) in strings)) + assert length(strings) == 16 + + assert {["1"], "label", "1"} in strings + assert {["1"], "description", "2"} in strings + assert {["1", "3"], "label", "3"} in strings + assert {["1", "3"], "description", "4"} in strings + assert {["1", "5"], "label", "5"} in strings + assert {["1", "5"], "description", "6"} in strings + assert {["7"], "label", "7"} in strings + assert {["7"], "description", "8"} in strings + assert {["7", "9"], "description", "9"} in strings + assert {["7", "9", "10"], "description", "10"} in strings + assert {["7", "9", "10", "11"], "description", "11"} in strings + assert {["7", "9", "10", nil], "description", "12"} in strings + assert {["7", nil], "label", "13"} in strings + assert {["14"], "label", "14"} in strings + assert {["15-15"], "label", "15"} in strings + assert {["16"], "label", "16"} in strings end end end -- cgit v1.2.3 From 597f56b4c4db3c63ff66fc93717d3b20655e1543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 16 Jul 2022 16:09:47 +0200 Subject: Use :utc_datetime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/web/mastodon_api/views/account_view_test.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index cc45ce4e9..8fa946d43 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -646,9 +646,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do mute_expires_at: mute_expires_at } = AccountView.render("show.json", %{user: other_user, for: user, mutes: true}) - assert NaiveDateTime.diff( + assert DateTime.diff( mute_expires_at, - NaiveDateTime.utc_now() |> NaiveDateTime.add(24 * 60 * 60) + DateTime.utc_now() |> DateTime.add(24 * 60 * 60) ) in -3..3 end end -- cgit v1.2.3 From 64e16e6a4be83e9328d62101cc21d10cf07e38fb Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 16 Jul 2022 23:44:37 -0600 Subject: Document way to do notice compatibility routes with Nginx reverse-proxy instead --- .../web/o_status/o_status_controller_test.exs | 50 ---------------------- .../web/plugs/frontend_static_plug_test.exs | 2 - 2 files changed, 52 deletions(-) (limited to 'test') diff --git a/test/pleroma/web/o_status/o_status_controller_test.exs b/test/pleroma/web/o_status/o_status_controller_test.exs index 5abbcfbdc..36e581f5e 100644 --- a/test/pleroma/web/o_status/o_status_controller_test.exs +++ b/test/pleroma/web/o_status/o_status_controller_test.exs @@ -343,54 +343,4 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do |> response(200) end end - - describe "notice compatibility routes" do - test "Soapbox FE", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/@#{user.nickname}/posts/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - - test "Mastodon", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/@#{user.nickname}/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - - test "Twitter", %{conn: conn} do - user = insert(:user) - note_activity = insert(:note_activity, user: user) - - resp = - conn - |> put_req_header("accept", "text/html") - |> get("/#{user.nickname}/status/#{note_activity.id}") - |> response(200) - - expected = - "" - - assert resp =~ expected - end - end end diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index a91e24c49..ab31c5f22 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -86,8 +86,6 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do "objects", "activities", "notice", - "@:nickname", - ":nickname", "users", "tags", "mailer", -- cgit v1.2.3 From fb268c43786d1b058a6ec1b53939d4c122ac2af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 17 Jul 2022 19:46:29 +0200 Subject: Allow to unset birthday MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/web/mastodon_api/update_credentials_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/pleroma/web/mastodon_api/update_credentials_test.exs b/test/pleroma/web/mastodon_api/update_credentials_test.exs index c2e4debc8..f5211a60e 100644 --- a/test/pleroma/web/mastodon_api/update_credentials_test.exs +++ b/test/pleroma/web/mastodon_api/update_credentials_test.exs @@ -390,6 +390,20 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do assert user_data["source"]["pleroma"]["show_birthday"] == true end + test "unsets birth date", %{conn: conn} do + patch(conn, "/api/v1/accounts/update_credentials", %{ + "birthday" => "2001-02-12" + }) + + res = + patch(conn, "/api/v1/accounts/update_credentials", %{ + "birthday" => "" + }) + + assert user_data = json_response_and_validate_schema(res, 200) + assert user_data["pleroma"]["birthday"] == nil + end + test "emojis in fields labels", %{conn: conn} do fields = [ %{"name" => ":firefox:", "value" => "is best 2hu"}, -- cgit v1.2.3 From 09e0304b9cfe9fb4365c0c6fafaffdb26defce10 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 1 Jul 2022 11:44:45 +0100 Subject: Add test for broken owncast federation --- test/fixtures/owncast-note-with-attachment.json | 31 ++++++++++++++++++++++ .../article_note_page_validator_test.exs | 11 ++++++++ 2 files changed, 42 insertions(+) create mode 100644 test/fixtures/owncast-note-with-attachment.json (limited to 'test') diff --git a/test/fixtures/owncast-note-with-attachment.json b/test/fixtures/owncast-note-with-attachment.json new file mode 100644 index 000000000..68cb6bbf7 --- /dev/null +++ b/test/fixtures/owncast-note-with-attachment.json @@ -0,0 +1,31 @@ +{ + "attachment": { + "content": "Live stream preview", + "type": "Image", + "url": "https://owncast.localhost.localdomain/preview.gif?us=KjfNX387gm" + }, + "attributedTo": "https://owncast.localhost.localdomain/federation/user/streamer", + "audience": "https://www.w3.org/ns/activitystreams#Public", + "content": "

I've gone live!

#owncast #streaming

https://owncast.localhost.localdomain", + "id": "https://owncast.localhost.localdomain/federation/KjBNuq8ng", + "published": "2022-04-17T15:42:03Z", + "tag": [ + { + "href": "https://directory.owncast.online/tags/owncast", + "name": "#owncast", + "type": "Hashtag" + }, + { + "href": "https://directory.owncast.online/tags/streaming", + "name": "#streaming", + "type": "Hashtag" + }, + { + "href": "https://directory.owncast.online/tags/owncast", + "name": "#owncast", + "type": "Hashtag" + } + ], + "to": "https://www.w3.org/ns/activitystreams#Public", + "type": "Note" +} diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs index f93537ed8..e59bf6787 100644 --- a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs @@ -43,4 +43,15 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) end + + test "a note with an attachment should work", _ do + insert(:user, %{ap_id: "https://owncast.localhost.localdomain/federation/user/streamer"}) + + note = + "test/fixtures/owncast-note-with-attachment.json" + |> File.read!() + |> Jason.decode!() + + %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) + end end -- cgit v1.2.3 From cfb21d011fbb8a06ffcd63840e4db3aae3643045 Mon Sep 17 00:00:00 2001 From: Haelwenn Date: Fri, 22 Jul 2022 23:19:49 +0000 Subject: Revert "Merge branch 'fix/emoji-react-qualification' into 'develop'" This reverts merge request !3684 --- test/fixtures/emoji-reaction-unqualified.json | 30 ---------------------- .../transmogrifier/emoji_react_handling_test.exs | 26 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 test/fixtures/emoji-reaction-unqualified.json (limited to 'test') diff --git a/test/fixtures/emoji-reaction-unqualified.json b/test/fixtures/emoji-reaction-unqualified.json deleted file mode 100644 index 722fd7092..000000000 --- a/test/fixtures/emoji-reaction-unqualified.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "EmojiReact", - "signature": { - "type": "RsaSignature2017", - "signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==", - "creator": "http://mastodon.example.org/users/admin#main-key", - "created": "2018-02-17T18:57:49Z" - }, - "object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454", - "content": "❤", - "nickname": "lain", - "id": "http://mastodon.example.org/users/admin#reactions/2", - "actor": "http://mastodon.example.org/users/admin", - "@context": [ - "https://www.w3.org/ns/activitystreams", - "https://w3id.org/security/v1", - { - "toot": "http://joinmastodon.org/ns#", - "sensitive": "as:sensitive", - "ostatus": "http://ostatus.org#", - "movedTo": "as:movedTo", - "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", - "inReplyToAtomUri": "ostatus:inReplyToAtomUri", - "conversation": "ostatus:conversation", - "atomUri": "ostatus:atomUri", - "Hashtag": "as:Hashtag", - "Emoji": "toot:Emoji" - } - ] -} diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index 41d96fa66..ceedb185f 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -37,32 +37,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do assert match?([["👌", _]], object.data["reactions"]) end - test "it works for incoming unqualified emoji reactions" do - user = insert(:user) - other_user = insert(:user, local: false) - {:ok, activity} = CommonAPI.post(user, %{status: "hello"}) - - data = - File.read!("test/fixtures/emoji-reaction-unqualified.json") - |> Jason.decode!() - |> Map.put("object", activity.data["object"]) - |> Map.put("actor", other_user.ap_id) - - {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) - - assert data["actor"] == other_user.ap_id - assert data["type"] == "EmojiReact" - assert data["id"] == "http://mastodon.example.org/users/admin#reactions/2" - assert data["object"] == activity.data["object"] - # heart emoji with added emoji variation sequence - assert data["content"] == "❤\uFE0F" - - object = Object.get_by_ap_id(data["object"]) - - assert object.data["reaction_count"] == 1 - assert match?([["❤\uFE0F", _]], object.data["reactions"]) - end - test "it reject invalid emoji reactions" do user = insert(:user) other_user = insert(:user, local: false) -- cgit v1.2.3 From 388bbc4978a97eb82554c6d8ebc8bb6c9d429080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne?= Date: Sun, 24 Jul 2022 13:31:35 +0200 Subject: EmojiReactValidator: fix emoji qualification Tries fully-qualifying emoji when receiving them, by adding the emoji variation sequence to the received reaction emoji. This issue arises when other instance software, such as Misskey, tries reacting with emoji that have unqualified or minimally qualified variants, like a red heart. Pleroma only accepts fully qualified emoji in emoji reactions, and refused those emoji. Now, Pleroma will attempt to properly qualify them first, and reject them if checks still fail. This commit contains changes to tests proposed by lanodan. Co-authored-by: Haelwenn --- test/fixtures/emoji-reaction-unqualified.json | 30 ++++++++++++++++++++++ .../transmogrifier/emoji_react_handling_test.exs | 26 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 test/fixtures/emoji-reaction-unqualified.json (limited to 'test') diff --git a/test/fixtures/emoji-reaction-unqualified.json b/test/fixtures/emoji-reaction-unqualified.json new file mode 100644 index 000000000..722fd7092 --- /dev/null +++ b/test/fixtures/emoji-reaction-unqualified.json @@ -0,0 +1,30 @@ +{ + "type": "EmojiReact", + "signature": { + "type": "RsaSignature2017", + "signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==", + "creator": "http://mastodon.example.org/users/admin#main-key", + "created": "2018-02-17T18:57:49Z" + }, + "object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454", + "content": "❤", + "nickname": "lain", + "id": "http://mastodon.example.org/users/admin#reactions/2", + "actor": "http://mastodon.example.org/users/admin", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "toot": "http://joinmastodon.org/ns#", + "sensitive": "as:sensitive", + "ostatus": "http://ostatus.org#", + "movedTo": "as:movedTo", + "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", + "inReplyToAtomUri": "ostatus:inReplyToAtomUri", + "conversation": "ostatus:conversation", + "atomUri": "ostatus:atomUri", + "Hashtag": "as:Hashtag", + "Emoji": "toot:Emoji" + } + ] +} diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index ceedb185f..41d96fa66 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -37,6 +37,32 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do assert match?([["👌", _]], object.data["reactions"]) end + test "it works for incoming unqualified emoji reactions" do + user = insert(:user) + other_user = insert(:user, local: false) + {:ok, activity} = CommonAPI.post(user, %{status: "hello"}) + + data = + File.read!("test/fixtures/emoji-reaction-unqualified.json") + |> Jason.decode!() + |> Map.put("object", activity.data["object"]) + |> Map.put("actor", other_user.ap_id) + + {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + + assert data["actor"] == other_user.ap_id + assert data["type"] == "EmojiReact" + assert data["id"] == "http://mastodon.example.org/users/admin#reactions/2" + assert data["object"] == activity.data["object"] + # heart emoji with added emoji variation sequence + assert data["content"] == "❤\uFE0F" + + object = Object.get_by_ap_id(data["object"]) + + assert object.data["reaction_count"] == 1 + assert match?([["❤\uFE0F", _]], object.data["reactions"]) + end + test "it reject invalid emoji reactions" do user = insert(:user) other_user = insert(:user, local: false) -- cgit v1.2.3 From fb3f6e1975fc44414af66377061bf30ceee9f9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne?= Date: Mon, 25 Jul 2022 16:49:23 +0200 Subject: EmojiReactValidator: use new qualification method --- test/fixtures/emoji-reaction-unqualified.json | 30 ---------------------- .../transmogrifier/emoji_react_handling_test.exs | 13 +++++++--- 2 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 test/fixtures/emoji-reaction-unqualified.json (limited to 'test') diff --git a/test/fixtures/emoji-reaction-unqualified.json b/test/fixtures/emoji-reaction-unqualified.json deleted file mode 100644 index 722fd7092..000000000 --- a/test/fixtures/emoji-reaction-unqualified.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "EmojiReact", - "signature": { - "type": "RsaSignature2017", - "signatureValue": "fdxMfQSMwbC6wP6sh6neS/vM5879K67yQkHTbiT5Npr5wAac0y6+o3Ij+41tN3rL6wfuGTosSBTHOtta6R4GCOOhCaCSLMZKypnp1VltCzLDoyrZELnYQIC8gpUXVmIycZbREk22qWUe/w7DAFaKK4UscBlHDzeDVcA0K3Se5Sluqi9/Zh+ldAnEzj/rSEPDjrtvf5wGNf3fHxbKSRKFt90JvKK6hS+vxKUhlRFDf6/SMETw+EhwJSNW4d10yMUakqUWsFv4Acq5LW7l+HpYMvlYY1FZhNde1+uonnCyuQDyvzkff8zwtEJmAXC4RivO/VVLa17SmqheJZfI8oluVg==", - "creator": "http://mastodon.example.org/users/admin#main-key", - "created": "2018-02-17T18:57:49Z" - }, - "object": "http://localtesting.pleroma.lol/objects/eb92579d-3417-42a8-8652-2492c2d4f454", - "content": "❤", - "nickname": "lain", - "id": "http://mastodon.example.org/users/admin#reactions/2", - "actor": "http://mastodon.example.org/users/admin", - "@context": [ - "https://www.w3.org/ns/activitystreams", - "https://w3id.org/security/v1", - { - "toot": "http://joinmastodon.org/ns#", - "sensitive": "as:sensitive", - "ostatus": "http://ostatus.org#", - "movedTo": "as:movedTo", - "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", - "inReplyToAtomUri": "ostatus:inReplyToAtomUri", - "conversation": "ostatus:conversation", - "atomUri": "ostatus:atomUri", - "Hashtag": "as:Hashtag", - "Emoji": "toot:Emoji" - } - ] -} diff --git a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs index 41d96fa66..9d99df27c 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/emoji_react_handling_test.exs @@ -42,11 +42,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do other_user = insert(:user, local: false) {:ok, activity} = CommonAPI.post(user, %{status: "hello"}) + # woman detective emoji, unqualified + unqualified_emoji = [0x1F575, 0x200D, 0x2640] |> List.to_string() + data = - File.read!("test/fixtures/emoji-reaction-unqualified.json") + File.read!("test/fixtures/emoji-reaction.json") |> Jason.decode!() |> Map.put("object", activity.data["object"]) |> Map.put("actor", other_user.ap_id) + |> Map.put("content", unqualified_emoji) {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) @@ -54,13 +58,14 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.EmojiReactHandlingTest do assert data["type"] == "EmojiReact" assert data["id"] == "http://mastodon.example.org/users/admin#reactions/2" assert data["object"] == activity.data["object"] - # heart emoji with added emoji variation sequence - assert data["content"] == "❤\uFE0F" + # woman detective emoji, fully qualified + emoji = [0x1F575, 0xFE0F, 0x200D, 0x2640, 0xFE0F] |> List.to_string() + assert data["content"] == emoji object = Object.get_by_ap_id(data["object"]) assert object.data["reaction_count"] == 1 - assert match?([["❤\uFE0F", _]], object.data["reactions"]) + assert match?([[emoji, _]], object.data["reactions"]) end test "it reject invalid emoji reactions" do -- cgit v1.2.3 From 5d3d6a58f72888b8714605032b417091a8891bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 31 Jul 2022 17:22:34 +0200 Subject: Use `duration` param for mute expiration duration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- test/pleroma/user_test.exs | 2 +- .../controllers/account_controller_test.exs | 35 ++++++++++++++++++++++ .../web/mastodon_api/views/account_view_test.exs | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs index 408389c3a..ce5510f24 100644 --- a/test/pleroma/user_test.exs +++ b/test/pleroma/user_test.exs @@ -1146,7 +1146,7 @@ defmodule Pleroma.UserTest do user = insert(:user) muted_user = insert(:user) - {:ok, _user_relationships} = User.mute(user, muted_user, %{expires_in: 60}) + {:ok, _user_relationships} = User.mute(user, muted_user, %{duration: 60}) assert User.mutes?(user, muted_user) worker = Pleroma.Workers.MuteExpireWorker diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs index ee9db4288..50639e246 100644 --- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs @@ -9,6 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do alias Pleroma.Repo alias Pleroma.Tests.ObanHelpers alias Pleroma.User + alias Pleroma.UserRelationship alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.InternalFetchActor alias Pleroma.Web.CommonAPI @@ -1011,6 +1012,40 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert %{"id" => _id, "muting" => false, "muting_notifications" => false} = json_response_and_validate_schema(conn, 200) end + + test "expiring", %{conn: conn, user: user} do + other_user = insert(:user) + + conn = + conn + |> put_req_header("content-type", "multipart/form-data") + |> post("/api/v1/accounts/#{other_user.id}/mute", %{"duration" => "86400"}) + + assert %{"id" => _id, "muting" => true} = json_response_and_validate_schema(conn, 200) + + mute_expires_at = UserRelationship.get_mute_expire_date(user, other_user) + + assert DateTime.diff( + mute_expires_at, + DateTime.utc_now() |> DateTime.add(24 * 60 * 60) + ) in -3..3 + end + + test "falls back to expires_in", %{conn: conn, user: user} do + other_user = insert(:user) + + conn + |> put_req_header("content-type", "multipart/form-data") + |> post("/api/v1/accounts/#{other_user.id}/mute", %{"expires_in" => "86400"}) + |> json_response_and_validate_schema(200) + + mute_expires_at = UserRelationship.get_mute_expire_date(user, other_user) + + assert DateTime.diff( + mute_expires_at, + DateTime.utc_now() |> DateTime.add(24 * 60 * 60) + ) in -3..3 + end end describe "pinned statuses" do diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 8fa946d43..692ec8c92 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -640,7 +640,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do other_user = insert(:user) {:ok, _user_relationships} = - User.mute(user, other_user, %{notifications: true, expires_in: 24 * 60 * 60}) + User.mute(user, other_user, %{notifications: true, duration: 24 * 60 * 60}) %{ mute_expires_at: mute_expires_at -- cgit v1.2.3