Passing the context to a function field

I am trying to retrieve the currency rate for a specific date. when I do :

...
import datetime
from dateutil.relativedelta import relativedelta
date = datetime.today() - relativedelta(days=20)
Currency = Pool().get('currency.currency')
currency, = Currency.search([('code', '=', 'USD')])
with Transaction().set_context(date=date):
    rate = currency.rate
...

In rate I don’t have the correct rate but the rate of today (Of course there is a rate for the requested date).

Have I missed something?

By rereading I think I have found …

...
Currency = Pool().get('currency.currency')
with Transaction().set_context(date=date):
    currency, = Currency.search([('code', '=', 'USD')])
    rate = currency.rate
...

sorry for the noise

Yes the instance are always using the context at the time they were instantiated.