Skip to content

Commit

Permalink
Add start and end time for 'Site' to factories. Make those times time…
Browse files Browse the repository at this point in the history
…zone aware
  • Loading branch information
micah-prime committed Oct 23, 2024
1 parent a05a6c6 commit 9db76b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions snowexsql/tables/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion tests/factories/layer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
2 changes: 2 additions & 0 deletions tests/factories/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9db76b9

Please sign in to comment.