OZtree
OZtree copied to clipboard
Check that recent changes to sponsorship to test sponsoring banned species are sane
In https://github.com/OneZoom/OZtree/commit/b0b5e9412ac74ac22fd4e675d094902ff8aa7517 I made a small change to set the ott_price_pence to float('inf') rather than None for species with a price of None (e.g. banned species). This allows me to run e.g. test_modules_usernames.py even if prices aren't set in the DB (see the allow_banned flag in https://github.com/OneZoom/OZtree/commit/c129495132e1cbb9b513cd0e6e5d36648f5c1c1e). I would appreciate it if @lentinj could, at his convenience, check that I haven't done something stupid that would mess with the sponsorship module. All tests still pass, so I think this is probably OK, but a second pair of eyes would be much appreciated!
This issue should be easy to close after that.
I think it'd certainly work, but would it be better to assign some prices randomly as part of the test utils to duck this? Any transactions are rolled back anyway, so we're not going to cause permanent damage to your dev setup.
I'm a bit nervous that we'll start making the float price part of our API as a result of this, as opposed to a bodge to reformat the number for PayPal (which probably should be using Decimal anyway).