diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-02-14 22:20:57 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-02-14 22:20:57 +0800 |
commit | 237193ef2a58d890d50e96fcc99481849c42dca9 (patch) | |
tree | 3418b87d6f631abb15678bb32dc897ba7a4dcd18 /models/models_test.go | |
parent | a30e5bcaf83a82f5f7d1c89a6f9f7e52036d74af (diff) | |
download | gitea-237193ef2a58d890d50e96fcc99481849c42dca9.tar.gz gitea-237193ef2a58d890d50e96fcc99481849c42dca9.zip |
add user models
Diffstat (limited to 'models/models_test.go')
-rw-r--r-- | models/models_test.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/models/models_test.go b/models/models_test.go index 80653d57fb..f4a40ff32c 100644 --- a/models/models_test.go +++ b/models/models_test.go @@ -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) } |