mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
461 B
31 lines
461 B
11 years ago
|
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)
|
||
|
}
|
||
|
}
|