From 6879d5040e73d1e7d6e7e1e85d780ba5ace37bb5 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 28 Feb 2022 20:22:11 +0000 Subject: [PATCH] Fix transactions tests --- handler/tests/test_transactions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/handler/tests/test_transactions.py b/handler/tests/test_transactions.py index b99277d..eed6dbd 100644 --- a/handler/tests/test_transactions.py +++ b/handler/tests/test_transactions.py @@ -3,6 +3,7 @@ from unittest.mock import MagicMock from copy import deepcopy import transactions +import money class TestTransactions(TestCase): @@ -52,6 +53,12 @@ class TestTransactions(TestCase): self.transactions.money.get_rates_all = MagicMock() 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 = { 1: { "id": "uuid1",