Adds two configuration parameters that are passed to
generate_password_hash:
- PASSWORD_HASH_METHOD
- PASSWORD_HASH_SALT_LENGTH
The unit tests use high-speed low-security values and
gain 50% speed.
This mock was already applied to all tests, because it was done statically
in the TestCurrencyConverter class definition. But it was really not
clear that it's applied everywhere.
Moving this to the setUp() function makes it much clearer.
Also, remove useless redefinition in other tests.
Most of the tests are using a separate database, but we have a few tests
that are loading default values and are writing to /tmp/ihatemoney.db.
This is annoying because it's also the database used for development:
running the test suite breaks the dev database.
To fix this, always use a separate testing database to avoid interference.
Co-authored-by: Alexis Métaireau <alexis@notmyidea.org>
Currency switching is both simpler and less powerful. This was done primarily for users, to have a clear and logical understanding, but the code is also simpler. The main change is that it is now forbidden to switch a project to "no currency" if bills don't share the same currency.
Also, tests assume that projects are created without currency, as in the web UI.