コード例 #1
0
def test_currency_precision_provider_basics():
    get_currency('USD', 2)
    get_currency('EUR', 2)
    get_currency('JPY', 0)
    assert get_currency_precision('USD') == Decimal('0.01')
    assert get_currency_precision('EUR') == Decimal('0.01')
    assert get_currency_precision('JPY') == Decimal('1')
コード例 #2
0
ファイル: test_currencies.py プロジェクト: ruqaiya/shuup
def test_currency_precision_provider_basics():
    get_currency('USD', 2)
    get_currency('EUR', 2)
    get_currency('JPY', 0)
    assert get_currency_precision('USD') == Decimal('0.01')
    assert get_currency_precision('EUR') == Decimal('0.01')
    assert get_currency_precision('JPY') == Decimal('1')
コード例 #3
0
ファイル: test_currencies.py プロジェクト: yurkobb/shuup
def test_currency_precision_provider_basics():
    get_currency("USD", 2)
    get_currency("EUR", 2)
    get_currency("JPY", 0)
    assert get_currency_precision("USD") == Decimal("0.01")
    assert get_currency_precision("EUR") == Decimal("0.01")
    assert get_currency_precision("JPY") == Decimal("1")
コード例 #4
0
def test_currency_precision_provider_override():
    currency_usd = get_currency("USD")
    currency_usd.decimal_places = 6
    currency_usd.save()
    assert get_currency_precision('USD') == Decimal('0.000001')
    assert currency_usd.decimal_places == 6

    # change it and check if the precision provider has updated
    currency_usd.decimal_places = 2
    currency_usd.save()
    assert get_currency_precision('USD') == Decimal('0.01')
コード例 #5
0
ファイル: test_currencies.py プロジェクト: ruqaiya/shuup
def test_currency_precision_provider_override():
    currency_usd = get_currency("USD")
    currency_usd.decimal_places = 6
    currency_usd.save()
    assert get_currency_precision('USD') == Decimal('0.000001')
    assert currency_usd.decimal_places == 6

    # change it and check if the precision provider has updated
    currency_usd.decimal_places = 2
    currency_usd.save()
    assert get_currency_precision('USD') == Decimal('0.01')
コード例 #6
0
def test_currency_precision_provider_non_existing():
    assert get_currency_precision('XPT') is None
コード例 #7
0
ファイル: test_currencies.py プロジェクト: ruqaiya/shuup
def test_currency_precision_provider_non_existing():
    assert get_currency_precision('XPT') is None