Skip to content

Commit

Permalink
refactor(test): update exchange rate based on 'frankfurter' provider
Browse files Browse the repository at this point in the history
(cherry picked from commit a3fd4db)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Oct 5, 2023
1 parent 1da808a commit 40e4758
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_exchange_rate(self):
self.clear_cache()
exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_selling")
self.assertFalse(exchange_rate == 60)
self.assertEqual(flt(exchange_rate, 3), 66.999)
self.assertEqual(flt(exchange_rate, 3), 66.894)

def test_exchange_rate_strict(self):
# strict currency settings
Expand All @@ -87,15 +87,15 @@ def test_exchange_rate_strict(self):

self.clear_cache()
exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying")
self.assertEqual(flt(exchange_rate, 3), 67.235)
self.assertEqual(flt(exchange_rate, 3), 67.79)

exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling")
self.assertEqual(exchange_rate, 62.9)

# Exchange rate as on 15th Dec, 2015
self.clear_cache()
exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_buying")
self.assertEqual(flt(exchange_rate, 3), 66.999)
self.assertEqual(flt(exchange_rate, 3), 66.894)

def test_exchange_rate_strict_switched(self):
# Start with allow_stale is True
Expand All @@ -108,4 +108,4 @@ def test_exchange_rate_strict_switched(self):
# Will fetch from fixer.io
self.clear_cache()
exchange_rate = get_exchange_rate("USD", "INR", "2016-01-15", "for_buying")
self.assertEqual(flt(exchange_rate, 3), 67.235)
self.assertEqual(flt(exchange_rate, 3), 67.79)

0 comments on commit 40e4758

Please sign in to comment.