From 2ce43a3390b2cfea92355b2743e72848c428b439 Mon Sep 17 00:00:00 2001 From: Nic Pottier Date: Mon, 17 Feb 2020 08:14:41 -0800 Subject: [PATCH] force UTC on our session when testing --- config/config.go | 2 +- testsuite/testsuite.go | 4 ++-- web/contact/testdata/apply_actions.json | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/config.go b/config/config.go index 68cce57e8..44f93cc86 100644 --- a/config/config.go +++ b/config/config.go @@ -56,7 +56,7 @@ type Config struct { // NewMailroomConfig returns a new default configuration object func NewMailroomConfig() *Config { return &Config{ - DB: "postgres://temba:temba@localhost/temba?sslmode=disable", + DB: "postgres://temba:temba@localhost/temba?sslmode=disable&Timezone=UTC", DBPoolSize: 36, Redis: "redis://localhost:6379/15", Elastic: "http://localhost:9200", diff --git a/testsuite/testsuite.go b/testsuite/testsuite.go index e4638ca15..b473a1997 100644 --- a/testsuite/testsuite.go +++ b/testsuite/testsuite.go @@ -33,7 +33,7 @@ func Reset() (context.Context, *sqlx.DB, *redis.Pool) { // then copying the mailroom_test.dump file to your mailroom root directory // % cp mailroom_test.dump ../mailroom func ResetDB() { - db := sqlx.MustOpen("postgres", "postgres://mailroom_test:temba@localhost/mailroom_test?sslmode=disable") + db := sqlx.MustOpen("postgres", "postgres://mailroom_test:temba@localhost/mailroom_test?sslmode=disable&Timezone=UTC") defer db.Close() db.MustExec("drop owned by mailroom_test cascade") dir, _ := os.Getwd() @@ -49,7 +49,7 @@ func ResetDB() { // DB returns an open test database pool func DB() *sqlx.DB { - db := sqlx.MustOpen("postgres", "postgres://mailroom_test:temba@localhost/mailroom_test?sslmode=disable") + db := sqlx.MustOpen("postgres", "postgres://mailroom_test:temba@localhost/mailroom_test?sslmode=disable&Timezone=UTC") return db } diff --git a/web/contact/testdata/apply_actions.json b/web/contact/testdata/apply_actions.json index 8dedee4e4..15ebb5e0e 100644 --- a/web/contact/testdata/apply_actions.json +++ b/web/contact/testdata/apply_actions.json @@ -15,7 +15,7 @@ "id": 10000, "name": "Cathy", "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [] }, @@ -48,7 +48,7 @@ "id": 10000, "name": "Kathy", "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [ { @@ -87,7 +87,7 @@ "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "id": 10000, "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [ { @@ -130,7 +130,7 @@ "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "id": 10000, "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00", + "created_on": "2018-07-06T12:30:00.123457Z", "fields": { "age": { "text": "24", @@ -186,7 +186,7 @@ "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "id": 10000, "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [ { @@ -234,7 +234,7 @@ "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "id": 10000, "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00", + "created_on": "2018-07-06T12:30:00.123457Z", "groups": [ { "uuid": "c153e265-f7c9-4539-9dbc-9b358714b638", @@ -289,7 +289,7 @@ "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "id": 10000, "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [ { @@ -334,7 +334,7 @@ "id": 10000, "language": "fra", "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00" + "created_on": "2018-07-06T12:30:00.123457Z" }, "events": [ { @@ -375,7 +375,7 @@ "id": 10000, "language": "fra", "timezone": "America/Los_Angeles", - "created_on": "2018-07-06T05:30:00.123457-07:00", + "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ "tel:0788555111" ]