NowInDefaultTimezone returns the current time rounded to the nearest microsecond in the default timezone used by postgres in tests. Useful for object equality checks.
()
| 82 | // NowInDefaultTimezone returns the current time rounded to the nearest microsecond in the default timezone |
| 83 | // used by postgres in tests. Useful for object equality checks. |
| 84 | func NowInDefaultTimezone() time.Time { |
| 85 | loc, err := time.LoadLocation(DefaultTimezone) |
| 86 | if err != nil { |
| 87 | panic(err) |
| 88 | } |
| 89 | return time.Now().In(loc).Round(time.Microsecond) |
| 90 | } |
| 91 | |
| 92 | func NewDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub) { |
| 93 | t.Helper() |
no outgoing calls