summaryrefslogtreecommitdiffstats
path: root/models/models_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-02-13 23:23:23 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-02-13 23:23:23 +0800
commita30e5bcaf83a82f5f7d1c89a6f9f7e52036d74af (patch)
tree287c8f68b2b13f8a780f5b2184685d852388c9d1 /models/models_test.go
parentb5ba3878913705cd75cef975e7b1a63c351ab86f (diff)
downloadgitea-a30e5bcaf83a82f5f7d1c89a6f9f7e52036d74af.tar.gz
gitea-a30e5bcaf83a82f5f7d1c89a6f9f7e52036d74af.zip
add createrepository & deleterepository
Diffstat (limited to 'models/models_test.go')
-rw-r--r--models/models_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/models/models_test.go b/models/models_test.go
new file mode 100644
index 0000000000..80653d57fb
--- /dev/null
+++ b/models/models_test.go
@@ -0,0 +1,30 @@
+package models
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/lunny/xorm"
+ _ "github.com/mattn/go-sqlite3"
+)
+
+func init() {
+ var err error
+ orm, err = xorm.NewEngine("sqlite3", "./test.db")
+ if err != nil {
+ fmt.Println(err)
+ }
+
+ err = orm.Sync(&User{}, &Org{}, &Repo{})
+ if err != nil {
+ fmt.Println(err)
+ }
+}
+
+func TestCreateRepository(t *testing.T) {
+ user := User{Id: 1}
+ err := CreateUserRepository("test", &user, "test")
+ if err != nil {
+ t.Error(err)
+ }
+}