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()
|
backend = get_exchange_rate_backend()
|
||||||
|
|
||||||
# Update rates
|
# Update rates
|
||||||
backend.update_rates()
|
backend.update_rates(base_currency=backend.base_currency)
|
||||||
|
|
||||||
|
|
||||||
def send_email(subject, body, recipients, from_email=None):
|
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 .models import rename_company_image
|
||||||
from part.models import Part
|
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
|
from djmoney.contrib.exchange.models import Rate
|
||||||
|
|
||||||
|
|
||||||
@ -41,12 +41,14 @@ class CompanySimpleTest(TestCase):
|
|||||||
self.zerglphs = SupplierPart.objects.get(SKU='ZERGLPHS')
|
self.zerglphs = SupplierPart.objects.get(SKU='ZERGLPHS')
|
||||||
self.zergm312 = SupplierPart.objects.get(SKU='ZERGM312')
|
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(
|
Rate.objects.create(
|
||||||
currency='AUD',
|
currency='AUD',
|
||||||
value='1.35',
|
value='1.35',
|
||||||
backend_id='inventree',
|
backend_id=backend.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_company_model(self):
|
def test_company_model(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user