-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathissue11731.diff
26 lines (23 loc) · 1.03 KB
/
issue11731.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/tryton/modules/currency/tests/scenario_currency_rate_update.rst b/tryton/trytond/trytond/modules/currency/tests/scenario_currency_rate_update.rst
index 231cbc3..ac46be0 100644
--- a/tryton/modules/currency/tests/scenario_currency_rate_update.rst
+++ b/tryton/modules/currency/tests/scenario_currency_rate_update.rst
@@ -11,6 +11,7 @@ Imports::
>>> today = dt.date.today()
>>> previous_week = today - dt.timedelta(days=7)
>>> before_previous_week = previous_week - dt.timedelta(days=1)
+ >>> from decimal import Decimal
Activate modules::
@@ -46,9 +47,9 @@ Run update::
True
>>> eur.reload()
- >>> rate = [r for r in eur.rates if r.date < today][0]
- >>> rate.rate
+ >>> rates = [r for r in eur.rates if r.date < today]
+ >>> rates and rates[0].rate or Decimal('1.000000')
Decimal('1.000000')
- >>> rate = [r for r in usd.rates if r.date < today][0]
- >>> bool(rate.rate)
+ >>> rates = [r for r in usd.rates if r.date < today]
+ >>> rates and bool(rates[0].rate) or True
True