mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Increase the number of days we calculate billing from 3 to 10 days.
Log exception if the billing counts for letters are different in the dvla response file than what we collected.
This commit is contained in:
@@ -308,7 +308,7 @@ def test_check_billable_units_when_billable_units_does_not_match_page_count(
|
||||
mocker,
|
||||
notification_update
|
||||
):
|
||||
mock_logger = mocker.patch('app.celery.tasks.current_app.logger.error')
|
||||
mock_logger = mocker.patch('app.celery.tasks.current_app.logger.exception')
|
||||
|
||||
notification = create_notification(sample_letter_template, reference='REFERENCE_ABC', billable_units=3)
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ def test_create_nightly_billing_consolidate_from_3_days_delta(
|
||||
mocker.patch('app.dao.fact_billing_dao.get_rate', side_effect=mocker_get_rate)
|
||||
|
||||
# create records from 11th to 15th
|
||||
for i in range(0, 5):
|
||||
for i in range(0, 11):
|
||||
sample_notification(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
@@ -302,7 +302,7 @@ def test_create_nightly_billing_consolidate_from_3_days_delta(
|
||||
)
|
||||
|
||||
notification = Notification.query.order_by(Notification.created_at).all()
|
||||
assert datetime.date(notification[0].created_at) == date(2018, 1, 11)
|
||||
assert datetime.date(notification[0].created_at) == date(2018, 1, 5)
|
||||
|
||||
records = FactBilling.query.all()
|
||||
assert len(records) == 0
|
||||
@@ -310,8 +310,8 @@ def test_create_nightly_billing_consolidate_from_3_days_delta(
|
||||
create_nightly_billing()
|
||||
records = FactBilling.query.order_by(FactBilling.bst_date).all()
|
||||
|
||||
assert len(records) == 3
|
||||
assert records[0].bst_date == date(2018, 1, 12)
|
||||
assert len(records) == 10
|
||||
assert records[0].bst_date == date(2018, 1, 5)
|
||||
assert records[-1].bst_date == date(2018, 1, 14)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user