Lets say I have this function
from datetime import date
def get_next_friday(base_date=date.today()):
next_friday = ...
return next_friday
Then I have a celery task to call this function without passing in the base_date
@celery_app.task
def refresh_settlement_date():
Record.objects.update(process_date=get_next_friday())
In the unittest I am running the refresh_settlement_date() task, but it's not providing the base_date when it's calling the get_next_friday(), my question is how to mock that parameter to test the days in the future?
I am trying to avoid adding parameter to become refresh_settlement_date(base_date) as it doesn't serve real purpose but only for unittest.