Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Apr 20, 2022
1 parent 7d9028e commit 241c617
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/models/globals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
func TestLoadGlobals(t *testing.T) {
ctx, rt, db, _ := testsuite.Get()

defer func() {
db.MustExec(`UPDATE globals_global SET value = 'Nyaruka' WHERE org_id = $1 AND key = $2`, testdata.Org1.ID, "org_name")
}()

// set one of our global values to empty
db.MustExec(`UPDATE globals_global SET value = '' WHERE org_id = $1 AND key = $2`, testdata.Org1.ID, "org_name")

Expand Down
2 changes: 2 additions & 0 deletions core/models/http_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func TestHTTPLogs(t *testing.T) {
func TestHTTPLogger(t *testing.T) {
ctx, _, db, _ := testsuite.Get()

defer func() { db.MustExec(`DELETE FROM request_logs_httplog`) }()

defer httpx.SetRequestor(httpx.DefaultRequestor)
httpx.SetRequestor(httpx.NewMockRequestor(map[string][]httpx.MockResponse{
"https://temba.io": {
Expand Down
2 changes: 1 addition & 1 deletion core/models/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestContactImports(t *testing.T) {
}{}
jsonx.MustUnmarshal(testJSON, &tcs)

oa, err := models.GetOrgAssets(ctx, rt, 1)
oa, err := models.GetOrgAssetsWithRefresh(ctx, rt, testdata.Org1.ID, models.RefreshOrg|models.RefreshChannels|models.RefreshGroups)
require.NoError(t, err)

uuids.SetGenerator(uuids.NewSeededGenerator(12345))
Expand Down

0 comments on commit 241c617

Please sign in to comment.