Fix transactions tests

This commit is contained in:
Mark Veidemanis 2022-02-28 20:22:11 +00:00
parent 90da53ce99
commit 6e1bb5a582
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ from unittest.mock import MagicMock
from copy import deepcopy from copy import deepcopy
import transactions import transactions
import money
class TestTransactions(TestCase): class TestTransactions(TestCase):
@ -52,6 +53,12 @@ class TestTransactions(TestCase):
self.transactions.money.get_rates_all = MagicMock() self.transactions.money.get_rates_all = MagicMock()
self.transactions.money.get_rates_all.return_value = {"GBP": 0.8} self.transactions.money.get_rates_all.return_value = {"GBP": 0.8}
# Don't mock the functions we want to test
self.money = money.Money()
self.money.get_rates_all = MagicMock()
self.money.get_rates_all.return_value = {"GBP": 0.8}
self.transactions.money.get_acceptable_margins = self.money.get_acceptable_margins
self.trades = { self.trades = {
1: { 1: {
"id": "uuid1", "id": "uuid1",