mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-30 19:28:50 -04:00
notify-281 fix time-sensitive tests
This commit is contained in:
@@ -495,7 +495,7 @@ def test_create_nightly_notification_status_for_service_and_day(notify_db_sessio
|
||||
def test_create_nightly_notification_status_for_service_and_day_overwrites_old_data(notify_db_session):
|
||||
first_service = create_service(service_name='First Service')
|
||||
first_template = create_template(service=first_service)
|
||||
process_day = date.today()
|
||||
process_day = datetime.utcnow().date()
|
||||
|
||||
# first run: one notification, expect one row (just one status)
|
||||
notification = create_notification(template=first_template, status='sending')
|
||||
|
||||
@@ -297,7 +297,6 @@ def create_notification(
|
||||
}
|
||||
notification = Notification(**data)
|
||||
dao_create_notification(notification)
|
||||
|
||||
return notification
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
from datetime import date, datetime
|
||||
from datetime import datetime
|
||||
|
||||
from flask import url_for
|
||||
|
||||
@@ -27,7 +27,8 @@ def test_template_history_version(notify_api, sample_user, sample_template):
|
||||
assert json_resp['data']['version'] == 1
|
||||
assert json_resp['data']['process_type'] == 'normal'
|
||||
assert json_resp['data']['created_by']['name'] == sample_user.name
|
||||
assert datetime.strptime(json_resp['data']['created_at'], '%Y-%m-%d %H:%M:%S.%f').date() == date.today()
|
||||
assert datetime.strptime(json_resp['data']['created_at'], '%Y-%m-%d %H:%M:%S.%f').date() == \
|
||||
datetime.utcnow().date()
|
||||
|
||||
|
||||
def test_previous_template_history_version(notify_api, sample_template):
|
||||
|
||||
Reference in New Issue
Block a user