Skip to content
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

Write tests involving models with TaxedMoneyField and save()/delete() calls #58

Open
rafalp opened this issue Feb 22, 2018 · 0 comments

Comments

@rafalp
Copy link
Contributor

rafalp commented Feb 22, 2018

During work on updating Saleor's codebase to use current prices, I've ran into plenty of edge cases with Django ORM accessing different attributes on TaxedMoneyField instances when running different operations.

Those could've been found much sooner if our test suite included following scenarios:

  1. model.save()
  2. model.save(update_fields)
  3. model.delete()

We should also explore how behavior of those changes for models that are:

  1. pointed to by ForeignKey in other model
  2. are pointing to other model via ForeignKey

This is because Django's ORM appears to look up related models fields, iterating on them and snooping out different attrs for its checks and validations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant