diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2021-11-18 18:42:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 01:42:27 +0800 |
commit | f34151bdb22c8160b0a6eafef20725ebae1768da (patch) | |
tree | 2abcc5845e4a9cf3769deb27ba5a3ecccd2ad8c9 /models/org_test.go | |
parent | 55be5fe3399d18b7d2477519707aecf5f99f1de5 (diff) | |
download | gitea-f34151bdb22c8160b0a6eafef20725ebae1768da.tar.gz gitea-f34151bdb22c8160b0a6eafef20725ebae1768da.zip |
Move user/org deletion to services (#17673)
Diffstat (limited to 'models/org_test.go')
-rw-r--r-- | models/org_test.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/models/org_test.go b/models/org_test.go index 2bc4d74fc3..8580702a06 100644 --- a/models/org_test.go +++ b/models/org_test.go @@ -261,24 +261,6 @@ func TestCountOrganizations(t *testing.T) { assert.Equal(t, expected, CountOrganizations()) } -func TestDeleteOrganization(t *testing.T) { - assert.NoError(t, unittest.PrepareTestDatabase()) - org := unittest.AssertExistsAndLoadBean(t, &User{ID: 6}).(*User) - assert.NoError(t, DeleteOrganization(org)) - unittest.AssertNotExistsBean(t, &User{ID: 6}) - unittest.AssertNotExistsBean(t, &OrgUser{OrgID: 6}) - unittest.AssertNotExistsBean(t, &Team{OrgID: 6}) - - org = unittest.AssertExistsAndLoadBean(t, &User{ID: 3}).(*User) - err := DeleteOrganization(org) - assert.Error(t, err) - assert.True(t, IsErrUserOwnRepos(err)) - - user := unittest.AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) - assert.Error(t, DeleteOrganization(user)) - unittest.CheckConsistencyFor(t, &User{}, &Team{}) -} - func TestIsOrganizationOwner(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(orgID, userID int64, expected bool) { |