mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fixed exchange rate backend test
This commit is contained in:
parent
27799b43b2
commit
bbd95f2c70
@ -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):
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user