Fixed exchange rate backend test

This commit is contained in:
eeintech 2021-05-20 14:52:56 -04:00
parent 27799b43b2
commit bbd95f2c70
2 changed files with 7 additions and 5 deletions

View File

@ -176,7 +176,7 @@ def update_exchange_rates():
backend = get_exchange_rate_backend()
# Update rates
backend.update_rates()
backend.update_rates(base_currency=backend.base_currency)
def send_email(subject, body, recipients, from_email=None):

View File

@ -11,7 +11,7 @@ from .models import Company, Contact, ManufacturerPart, SupplierPart
from .models import rename_company_image
from part.models import Part
from InvenTree.exchange import InvenTreeManualExchangeBackend
from InvenTree.exchange import get_exchange_rate_backend
from djmoney.contrib.exchange.models import Rate
@ -40,13 +40,15 @@ class CompanySimpleTest(TestCase):
self.acme0002 = SupplierPart.objects.get(SKU='ACME0002')
self.zerglphs = SupplierPart.objects.get(SKU='ZERGLPHS')
self.zergm312 = SupplierPart.objects.get(SKU='ZERGM312')
InvenTreeManualExchangeBackend().update_rates()
# Exchange rate backend
backend = get_exchange_rate_backend()
backend.update_rates(base_currency=backend.base_currency)
Rate.objects.create(
currency='AUD',
value='1.35',
backend_id='inventree',
backend_id=backend.name,
)
def test_company_model(self):