From 5f92357339ecc0f0b6583b93d821652dc60e503d Mon Sep 17 00:00:00 2001 From: Maximilian Girlich Date: Tue, 8 Aug 2023 09:40:49 +0200 Subject: [PATCH] Add missing timezone in tests (#1349) --- tests/testthat/test-backend-access.R | 4 ++-- tests/testthat/test-backend-mysql.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-backend-access.R b/tests/testthat/test-backend-access.R index 9a0a003f9..a37a29fa0 100644 --- a/tests/testthat/test-backend-access.R +++ b/tests/testthat/test-backend-access.R @@ -60,8 +60,8 @@ test_that("custom escaping works as expected", { expect_equal(escape(as.Date("2020-01-01"), con = con), sql("#2020-01-01#")) expect_equal(escape(as.Date(NA), con = con), sql("NULL")) - expect_equal(escape(as.POSIXct("2020-01-01"), con = con), sql("#2020-01-01 00:00:00#")) - expect_equal(escape(as.POSIXct(NA), con = con), sql("NULL")) + expect_equal(escape(as.POSIXct("2020-01-01", tz = "UTC"), con = con), sql("#2020-01-01 00:00:00#")) + expect_equal(escape(as.POSIXct(NA, tz = "UTC"), con = con), sql("NULL")) }) test_that("queries translate correctly", { diff --git a/tests/testthat/test-backend-mysql.R b/tests/testthat/test-backend-mysql.R index 38a4f14b2..163328246 100644 --- a/tests/testthat/test-backend-mysql.R +++ b/tests/testthat/test-backend-mysql.R @@ -25,8 +25,8 @@ test_that("custom date escaping works as expected", { expect_equal(escape(as.Date("2020-01-01"), con = con), sql("'2020-01-01'")) expect_equal(escape(as.Date(NA), con = con), sql("NULL")) - expect_equal(escape(as.POSIXct("2020-01-01"), con = con), sql("'2020-01-01 00:00:00'")) - expect_equal(escape(as.POSIXct(NA), con = con), sql("NULL")) + expect_equal(escape(as.POSIXct("2020-01-01", tz = "UTC"), con = con), sql("'2020-01-01 00:00:00'")) + expect_equal(escape(as.POSIXct(NA, tz = "UTC"), con = con), sql("NULL")) })