(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestModelQuery(t *testing.T) { |
| 33 | t.Parallel() |
| 34 | |
| 35 | app, _ := tests.NewTestApp() |
| 36 | defer app.Cleanup() |
| 37 | |
| 38 | modelsQuery := app.ModelQuery(&core.Collection{}) |
| 39 | logsModelQuery := app.AuxModelQuery(&core.Collection{}) |
| 40 | |
| 41 | if app.ConcurrentDB() == modelsQuery.Info().Builder { |
| 42 | t.Fatalf("ModelQuery() is not using app.ConcurrentDB()") |
| 43 | } |
| 44 | |
| 45 | if app.AuxConcurrentDB() == logsModelQuery.Info().Builder { |
| 46 | t.Fatalf("AuxModelQuery() is not using app.AuxConcurrentDB()") |
| 47 | } |
| 48 | |
| 49 | expectedSQL := "SELECT {{_collections}}.* FROM `_collections`" |
| 50 | for i, q := range []*dbx.SelectQuery{modelsQuery, logsModelQuery} { |
| 51 | sql := q.Build().SQL() |
| 52 | if sql != expectedSQL { |
| 53 | t.Fatalf("[%d] Expected select\n%s\ngot\n%s", i, expectedSQL, sql) |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func TestValidate(t *testing.T) { |
| 59 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…