From a7c78d0abb2ce3b44c8db67b12d658bed960306f Mon Sep 17 00:00:00 2001 From: Konsta Vesterinen Date: Sat, 15 Feb 2014 10:54:09 +0200 Subject: [PATCH] Add tz tests for ArrowType --- tests/types/test_arrow.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/types/test_arrow.py b/tests/types/test_arrow.py index d68e1b2..c1b4f00 100644 --- a/tests/types/test_arrow.py +++ b/tests/types/test_arrow.py @@ -31,3 +31,20 @@ class TestArrowDateTimeType(TestCase): created_at='1367900664' ) assert article.created_at.year == 2013 + + def test_utc(self): + time = arrow.arrow.utcnow() + article = self.Article(created_at=time) + self.session.add(article) + assert article.created_at == time + self.session.commit() + assert article.created_at == time + + def test_other_tz(self): + time = arrow.arrow.utcnow() + local = time.to('US/Pacific') + article = self.Article(created_at=local) + self.session.add(article) + assert article.created_at == time == local + self.session.commit() + assert article.created_at == time