test: Global OAuth should not be deleted

Expected to fail: Global (instance-wide) OAuth application should not be deleted, but it is

(cherry picked from commit 665d5f7317)
This commit is contained in:
Otto Richter 2024-11-23 19:49:55 +01:00 committed by forgejo-backport-action
parent 73d9e14e80
commit 90db3f6132
2 changed files with 9 additions and 0 deletions

View file

@ -23,3 +23,11 @@
redirect_uris: '["http://127.0.0.1", "https://127.0.0.1"]'
created_unix: 1712358091
updated_unix: 1712358091
-
id: 1003
uid: 0
name: "Global Auth source that should be kept"
client_id: "2f3467c1-7b3b-463d-ab04-2ae2b2712826"
redirect_uris: '["http://example.com/globalapp", "https://example.com/globalapp"]'
created_unix: 1732387292
updated_unix: 1732387292

View file

@ -296,4 +296,5 @@ func TestOrphanedOAuth2Applications(t *testing.T) {
require.NoError(t, err)
assert.EqualValues(t, 0, count)
unittest.AssertExistsIf(t, false, &auth_model.OAuth2Application{ID: 1002})
unittest.AssertExistsIf(t, true, &auth_model.OAuth2Application{ID: 1003})
}