Skip to content

Commit

Permalink
make tests pass when run in other time zones
Browse files Browse the repository at this point in the history
  • Loading branch information
timcharper committed Apr 2, 2014
1 parent 07af1ac commit f54607b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Expand Up @@ -3,6 +3,7 @@ package com.github.tminglei.slickpg
import org.joda.time.{Period, LocalDateTime, LocalTime, LocalDate, DateTime}
import org.junit.{After, Before, Test}
import org.junit.Assert._
import scala.slick.jdbc.StaticQuery

class PgDateSupportJodaTest {
import MyPostgresDriver.simple._
Expand Down Expand Up @@ -42,6 +43,7 @@ class PgDateSupportJodaTest {
@Test
def testDatetimeFunctions(): Unit = {
db withSession { implicit session: Session =>
(StaticQuery.u + "SET TIMEZONE TO '+8';").execute
Datetimes forceInsertAll (testRec1, testRec2, testRec3)

// datetime - '+'/'-'
Expand Down
Expand Up @@ -3,6 +3,7 @@ package com.github.tminglei.slickpg
import org.junit._
import org.junit.Assert._
import org.threeten.bp.{Duration, LocalDateTime, LocalTime, LocalDate, ZonedDateTime}
import scala.slick.jdbc.StaticQuery

class PgDate2SupportTest {
import MyPostgresDriver.simple._
Expand Down Expand Up @@ -42,6 +43,7 @@ class PgDate2SupportTest {
@Test
def testDatetimeFunctions(): Unit = {
db withSession { implicit session: Session =>
(StaticQuery.u + "SET TIMEZONE TO '+8';").execute
Datetimes forceInsertAll (testRec1, testRec2, testRec3)

// datetime - '+'/'-'
Expand Down
Expand Up @@ -7,6 +7,7 @@ import java.util.Calendar
import java.text.SimpleDateFormat
import javax.xml.bind.DatatypeConverter
import com.github.tminglei.slickpg.date.PgDateJavaTypes
import scala.slick.jdbc.StaticQuery

class gDateSupportTest {
import MyPostgresDriver.simple._
Expand Down Expand Up @@ -55,6 +56,7 @@ class gDateSupportTest {
@Test
def testDatetimeFunctions(): Unit = {
db withSession { implicit session: Session =>
(StaticQuery.u + "SET TIMEZONE TO '+8';").execute
Datetimes forceInsertAll (testRec1, testRec2, testRec3)

// datetime - '+'/'-'
Expand Down

0 comments on commit f54607b

Please sign in to comment.