mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-27 16:35:57 +00:00
This PR is part of https://codeberg.org/forgejo/forgejo/pulls/4767 This should not have an outside impact but bring all model changes needed & bring migrations. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8078 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de> Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
27 lines
577 B
Go
27 lines
577 B
Go
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package user
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"forgejo.org/modules/validation"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_FederatedUserFollowerValidation(t *testing.T) {
|
|
sut := FederatedUserFollower{
|
|
FollowedUserID: 12,
|
|
FollowingUserID: 1,
|
|
}
|
|
res, err := validation.IsValid(sut)
|
|
assert.Truef(t, res, "sut should be valid but was %q", err)
|
|
|
|
sut = FederatedUserFollower{
|
|
FollowedUserID: 1,
|
|
}
|
|
res, _ = validation.IsValid(sut)
|
|
assert.False(t, res, "sut should be invalid")
|
|
}
|