Skip to content

Commit

Permalink
force UTC on our session when testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Feb 17, 2020
1 parent cf1b01a commit 2ce43a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}

Expand Down
18 changes: 9 additions & 9 deletions web/contact/testdata/apply_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
},
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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"
]
Expand Down

0 comments on commit 2ce43a3

Please sign in to comment.