gorm_gen_test.go 449 B

1234567891011121314151617181920
  1. package database
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. const dbHost = "wallet:wallet@tcp(localhost:3306)/%s?charset=utf8mb4&parseTime=True&loc=Local"
  7. const wechat_path = "/wechat"
  8. const tool_path = "/tool"
  9. func Test_generateWechatDbModel(t *testing.T) {
  10. dsn := fmt.Sprintf(dbHost, "wechat")
  11. generateGormDbModel(dsn, wechat_path)
  12. }
  13. func Test_generateToolDbModel(t *testing.T) {
  14. dsn := fmt.Sprintf(dbHost, "tool")
  15. generateGormDbModel(dsn, tool_path)
  16. }