mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
rename days_ago to midnight_n_days_ago
also add some more timezone boundary tests and minor code cleanup
This commit is contained in:
@@ -81,7 +81,7 @@ def cache_key_for_service_template_counter(service_id, limit_days=7):
|
||||
|
||||
def cache_key_for_service_template_usage_per_day(service_id, datetime):
|
||||
"""
|
||||
You should probably pass a BST datetime into this function
|
||||
You should pass a BST datetime into this function
|
||||
"""
|
||||
return "service-{}-template-usage-{}".format(service_id, datetime.date().isoformat())
|
||||
|
||||
@@ -95,7 +95,7 @@ def get_public_notify_type_text(notify_type, plural=False):
|
||||
return '{}{}'.format(notify_type_text, 's' if plural else '')
|
||||
|
||||
|
||||
def days_ago(number_of_days):
|
||||
def midnight_n_days_ago(number_of_days):
|
||||
"""
|
||||
Returns midnight a number of days ago. Takes care of daylight savings etc.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user