Skip to content

Commit

Permalink
Development (#15)
Browse files Browse the repository at this point in the history
Moving multi-tenant test into primary test
  • Loading branch information
BitlyTwiser authored Jan 18, 2023
1 parent 01d4fbf commit 1f2f382
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
25 changes: 0 additions & 25 deletions tinyorm_multitenant_test.go

This file was deleted.

18 changes: 18 additions & 0 deletions tinyorm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,21 @@ func UpdateVehicle(model any) error {

return nil
}

var databaseConnections = []string{"development", "development-mysql"}

func TestMultiTenant(t *testing.T) {
t.Skipf("Skipping multi-tenant test")
mtc, err := tinyorm.MultiConnect(databaseConnections...)
if err != nil {
t.Fatal(err)
}

if err := mtc.SwitchDB("development").Create(&TestNoID{Stuff: "More Test PSQL"}); err != nil {
t.Fatalf("error creating test on psqlDB. error: %v", err.Error())
}

if err := mtc.SwitchDB("development-mysql").Create(&TestNoID{Stuff: "More Test MySql"}); err != nil {
t.Fatalf("error creating test on mysql. error: %v", err.Error())
}
}

0 comments on commit 1f2f382

Please sign in to comment.