New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ModelWithNullableCurrency): error was raised when trying to do a select #427
Conversation
Codecov Report
@@ Coverage Diff @@
## master #427 +/- ##
=======================================
Coverage 97.55% 97.55%
=======================================
Files 29 29
Lines 900 900
Branches 153 153
=======================================
Hits 878 878
Misses 15 15
Partials 7 7
Continue to review full report at Codecov.
|
Hello @woile ! Could you, please, rewrite the tests in the following way, to be more in line with the rest of the code? def test_query_not_null(self):
money = Money(100, 'EUR')
ModelWithNullableCurrency.objects.create(money=money)
instance = ModelWithNullableCurrency.objects.get()
assert instance.money == money
def test_query_null(self):
ModelWithNullableCurrency.objects.create()
instance = ModelWithNullableCurrency.objects.get()
assert instance.money is None
assert instance.money_currency is None And add an entry to the changelog? Thank you |
…select Steps to reproduce: 1. Create instance an assigned a Money value 2. Save instance 3. Do a Model.objects.all() 4. Observe "ValueError: Missing currency value"
Done! |
Thank you! :) |
TODO: is the currency field guaranteed to appear before the amount (and main) field? yes because of the creation_counters?
TODO: is the currency field guaranteed to appear before the amount (and main) field? yes because of the creation_counters?
TODO: is the currency field guaranteed to appear before the amount (and main) field? yes because of the creation_counters?
TODO: is the currency field guaranteed to appear before the amount (and main) field? yes because of the creation_counters?
Hello everyone, I found this weird error, I also added a patch, but I would like someone to take a first look.
For the error observe the first test I've added:
After doing that an error like this appears:
Steps to reproduce: