This commit is contained in:
Michael Jerger 2024-05-16 08:15:43 +02:00
parent fe3473fc8b
commit 1c7a9b00be
6 changed files with 278 additions and 0 deletions

View file

@ -1,4 +1,5 @@
// Copyright 2017 The Gitea Authors. All rights reserved.
// Copyright 2024 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package user_test
@ -107,6 +108,15 @@ func TestGetAllUsers(t *testing.T) {
assert.False(t, found[user_model.UserTypeOrganization], users)
}
func TestAPAPIURL(t *testing.T) {
user := user_model.User{ID: 1}
url := user.APAPIURL()
expected := "https://try.gitea.io/api/v1/activitypub/user-id/1"
if url != expected {
t.Errorf("unexpected APAPIURL, expected: %q, actual: %q", expected, url)
}
}
func TestSearchUsers(t *testing.T) {
defer tests.AddFixtures("models/user/fixtures/")()
assert.NoError(t, unittest.PrepareTestDatabase())