mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans, usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0. Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
45 lines
897 B
Go
45 lines
897 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hanzoai/commerce/datastore"
|
|
"github.com/hanzoai/commerce/models/fixtures"
|
|
"github.com/hanzoai/commerce/util/nscontext"
|
|
"github.com/hanzoai/commerce/util/test/ae"
|
|
"github.com/hanzoai/commerce/util/zipctx"
|
|
|
|
. "github.com/hanzoai/commerce/util/test/ginkgo"
|
|
)
|
|
|
|
func Test(t *testing.T) {
|
|
Setup("models/mixin", t)
|
|
}
|
|
|
|
var (
|
|
ctx ae.Context
|
|
db *datastore.Datastore
|
|
bcDb *datastore.Datastore
|
|
)
|
|
|
|
// Setup test context
|
|
var _ = BeforeSuite(func() {
|
|
ctx = ae.NewContext()
|
|
c := zipctx.New(ctx)
|
|
|
|
// Create the suchtees org and namespace for realism
|
|
fixtures.Organization(c)
|
|
|
|
// Create dbs for the two namespaces
|
|
nsCtx := nscontext.WithNamespace(ctx, "suchtees")
|
|
db = datastore.New(nsCtx)
|
|
|
|
nsCtx = nscontext.WithNamespace(ctx, "_blockchains")
|
|
bcDb = datastore.New(nsCtx)
|
|
})
|
|
|
|
// Tear-down test context
|
|
var _ = AfterSuite(func() {
|
|
ctx.Close()
|
|
})
|