problems with money_maker.py
See original GitHub issuedoing tests in python 3.6 everything works correctly.
The problem happens when using python version 3.8.3 it throws the following error:
ValueError at /es/admin/medexample/product/
Can not add/substract money in different currencies.
Request Method: GET
Request URL: http://localhost:8000/es/admin/medexample/product/
Django Version: 3.0.7
Exception Type: ValueError
Exception Value:
Can not add/substract money in different currencies.
Exception Location: /home/kira/.virtualenvs/vmedexample/lib/python3.8/site-packages/shop/money/money_maker.py in _assert_addable, line 220
Python Executable: /home/kira/.virtualenvs/vmedexample/bin/python
Python Version: 3.8.3
Python Path:
['/home/kira/Desarrollo/implementacion/medexample',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
'/home/kira/.virtualenvs/vmedexample/lib/python3.8/site-packages']
Server time: Mié, 17 Jun 2020 17:46:00 +0000
/home/kira/.virtualenvs/vmedexample/lib/python3.8/site-packages/shop/money/money_maker.py in _assert_addable
return 10**CURRENCIES[cls._currency_code][1]
def _assert_addable(self, other):
if not other:
# so that we can add/substract zero or None to any currency
return self.__class__('0')
if self._currency_code != getattr(other, '_currency_code', None):
raise ValueError("Can not add/substract money in different currencies.") …
return other
def _assert_multipliable(self, other):
if hasattr(other, '_currency_code'):
raise ValueError("Can not multiply currencies.")
if isinstance(other, float):
▼ Local vars
Variable Value
other
Decimal('399.00')
self
MoneyInEUR('399.000')
It is a project started with “cookiecutter-django-shop”, with all the data loaded with proof.
The error comes out when trying to access:
“http://localhost:8000/es/admin/medexample/product/”
clarify that it ran with python version 3.8.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Problems with "Money Maker" Project in the C# Course
Hello everyone, I am having difficulty in getting the code to produce the desired outcome in the test cases eg. 16 should produce...
Read more >Money Maker Camera Harness by HoldFast Gear - SLR Lounge
So, it's safe to say that anything you can strap to it is going to stay attached! The leather is going to be...
Read more >Market Timing Fails as a Money Maker - Investopedia
Market timing is not easily achievable. Over a sustained period of time, almost all investors profit more simply by investing immediately. Timing the...
Read more >Practice_Problems_1.pdf - IMSE3105/3115 Practice Problems ...
IMSE3105/3115 Practice Problems I October 8, 2018 Questions: 1. ... Stan Moneymaker presently owns a 10-year-old automobile with low mileage (78,000 miles).
Read more >Moneymaker Tomatoes Plant Care & Growing Tips | Horticulture
Common Problems. There are a few pests who are keen to get at tomatoes. Aphids. The little sap-suckers love to feed on plants ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm, Python 3.8.6, default settings
@darekmeco would you mind adding a unit test which reproduces this error on Python-3.8 but works on Python<=3.7?