Fix unit tests (#62)

This commit is contained in:
Fredrik Ringqvist
2022-07-28 13:46:50 +02:00
committed by GitHub
parent 934537f0b9
commit 80dee6bd86
2 changed files with 27 additions and 2 deletions
+4
View File
@@ -3,6 +3,7 @@ import flask_testing
from api import create_app, db
from api.models.product import Material, Product, Currencies
from api.models import Inquiry, Designer, Market
from unittest.mock import patch
class TestEndpoints(flask_testing.TestCase):
@@ -11,10 +12,13 @@ class TestEndpoints(flask_testing.TestCase):
def setUp(self):
db.create_all()
self._price_adjustments_patcher = patch('api.lib.prices.get_price_adjustment', return_value=1.0)
self._price_adjustments_patcher.start()
def tearDown(self):
db.session.remove()
db.drop_all()
self._price_adjustments_patcher.stop()
def _add_market(self):
currency = Currencies(iso3char="SEK", exchange_rate=1)