mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	add user models
This commit is contained in:
		@@ -15,15 +15,28 @@ func init() {
 | 
			
		||||
		fmt.Println(err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = orm.Sync(&User{}, &Org{}, &Repo{})
 | 
			
		||||
	orm.ShowSQL = true
 | 
			
		||||
	orm.ShowDebug = true
 | 
			
		||||
 | 
			
		||||
	err = orm.Sync(&User{}, &Repo{})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Println(err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	root = "test"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestCreateRepository(t *testing.T) {
 | 
			
		||||
	user := User{Id: 1}
 | 
			
		||||
	err := CreateUserRepository("test", &user, "test")
 | 
			
		||||
	user := User{Id: 1, Type: Individual}
 | 
			
		||||
	_, err := CreateRepository(&user, "test")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Error(err)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestDeleteRepository(t *testing.T) {
 | 
			
		||||
	user := User{Id: 1, Type: Individual}
 | 
			
		||||
	err := DeleteRepository(&user, "test")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Error(err)
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user