From 9db76b954d816b0a9f6fc06afa6ceba5fe9ee613 Mon Sep 17 00:00:00 2001 From: Micah Sandusky Date: Wed, 23 Oct 2024 13:35:08 -0600 Subject: [PATCH] Add start and end time for 'Site' to factories. Make those times timezone aware --- snowexsql/tables/site.py | 4 ++-- tests/factories/layer_data.py | 4 +++- tests/factories/site.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/snowexsql/tables/site.py b/snowexsql/tables/site.py index ecf3548..79cc1a1 100644 --- a/snowexsql/tables/site.py +++ b/snowexsql/tables/site.py @@ -53,8 +53,8 @@ class Site(SingleLocationData, Base, InCampaign, HasDOI): vegetation_height = Column(String()) tree_canopy = Column(String()) site_notes = Column(String()) - start_time = Column(Time) - end_time = Column(Time) + start_time = Column(Time(timezone=True)) + end_time = Column(Time(timezone=True)) @hybrid_property def date(self): diff --git a/tests/factories/layer_data.py b/tests/factories/layer_data.py index 5d51a7c..1d9ce8c 100644 --- a/tests/factories/layer_data.py +++ b/tests/factories/layer_data.py @@ -25,4 +25,6 @@ class Meta: ) instrument = factory.SubFactory(InstrumentFactory, name='Density Cutter') doi = factory.SubFactory(DOIFactory) - site = factory.SubFactory(SiteFactory) + site = factory.SubFactory( + SiteFactory, start_time='10:32:00', end_time='10:39:00' + ) diff --git a/tests/factories/site.py b/tests/factories/site.py index f70e291..b712d0c 100644 --- a/tests/factories/site.py +++ b/tests/factories/site.py @@ -31,6 +31,8 @@ class Meta: vegetation_height = "None" tree_canopy = "Open" site_notes = "Site Notes" + start_time = '10:32:00' + end_time = '10:39:00' # Single Location data geom = WKTElement(