1
0
Fork 0
forked from forgejo/forgejo

Move user related model into models/user (#17781)

* Move user related model into models/user

* Fix lint for windows

* Fix windows lint

* Fix windows lint

* Move some tests in models

* Merge
This commit is contained in:
Lunny Xiao 2021-11-24 17:49:20 +08:00 committed by GitHub
parent 4e7ca946da
commit a666829a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
345 changed files with 4230 additions and 3813 deletions

View file

@ -15,7 +15,7 @@ import (
)
func assertUserDeleted(t *testing.T, userID int64) {
unittest.AssertNotExistsBean(t, &models.User{ID: userID})
unittest.AssertNotExistsBean(t, &user_model.User{ID: userID})
unittest.AssertNotExistsBean(t, &user_model.Follow{UserID: userID})
unittest.AssertNotExistsBean(t, &user_model.Follow{FollowID: userID})
unittest.AssertNotExistsBean(t, &models.Repository{OwnerID: userID})
@ -38,7 +38,7 @@ func TestUserDeleteAccount(t *testing.T) {
session.MakeRequest(t, req, http.StatusFound)
assertUserDeleted(t, 8)
unittest.CheckConsistencyFor(t, &models.User{})
unittest.CheckConsistencyFor(t, &user_model.User{})
}
func TestUserDeleteAccountStillOwnRepos(t *testing.T) {
@ -53,5 +53,5 @@ func TestUserDeleteAccountStillOwnRepos(t *testing.T) {
session.MakeRequest(t, req, http.StatusFound)
// user should not have been deleted, because the user still owns repos
unittest.AssertExistsAndLoadBean(t, &models.User{ID: 2})
unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
}