aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/tests/tests.py
AgeCommit message (Collapse)AuthorFilesLines
2020-07-26Add test case for CVE-2020-15120Baptiste Jonglez1-0/+125
2020-05-24Populate the demo project with defaults. (#616)Daniel Atwood1-1/+5
2020-05-21Improve error handling when sending emails (#595)zorun1-16/+113
In one case, we were not catching a family of possible exceptions (socket.error), and in the two other cases there was no error handling at all. Sending emails can easily fail if no email server is configured, so it is really necessary to handle these errors instead of crashing with a HTTP 500 error. Refactor email sending code and add proper error handling. Show alert messages that tell the user if an email was sent or if there was an error. When sending a password reminder email or inviting people by email, we don't proceed to the next step in case of error, because sending emails is the whole point of these actions.
2020-05-10use currency format everywhere (#619)Glandos1-4/+6
This should unify the number formats, along with #618
2020-05-04Fix order of participants in the statistics page (#608)zorun1-108/+98
This fixes #607 and add a test case for this bug. It also renames participants in test cases to avoid alphabetical ordering. Inserting participants in alphabetical order is a special case, because ordering by ID will be the same as ordering by name. This is a bad idea in test cases, as #607 has shown.
2020-04-29Feature/currencies (#541)dark0dave1-1/+50
Now each project can have a currency, default to None. Each bill can use a different currency, and a conversion to project default currency is done on settle. Fix #512
2020-04-26Fix string representation of bills (#584)zorun1-23/+13
Currently the string representation of a Bill is: "<amount> for <description>" It is used in the History Page to describe changes that were applied to Bills, for instance: Bill "42.0 for Test" renamed to "Another Test" This is inconsistent, not easy to read, and the "for" in the middle is not translatable. To solve this issue, simply switch the string representation of a bill to its description. Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org>
2020-04-25Fix translations (#575)zorun1-6/+8
* Fix user-facing string and update translation catalog In the flash message confirming member creation, change "member had been added" into the correct form "member has been added". No translation has been changed. Some translators seem to have already spotted the mistake while translating, but I can't tell for all languages. * Change "Person" to "Participant" in history view Currently, the main user-facing term is "Participant", as seen for instance in the "Add participant" form. "Person" is not used anywhere in the interface. See #302 for a more general discussion on choosing the right terminology. * Fix obsolete translations. Co-authored-by: Baptiste Jonglez <git@bitsofnetworks.org> Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
2020-04-24Remove obsolete python code (<3.6). (#571)Rémy HUBSCHER1-47/+38
2020-04-21Add isort support. (#561)Rémy HUBSCHER1-12/+9
2020-04-20Add Project History Page (#553)Andrew Dickinson1-1/+647
Co-Authored-By: Glandos <bugs-github@antipoul.fr> All project activity can be tracked, using SQLAlchemy-continuum. IP addresses can optionally be recorded.
2020-02-20Align tables in statistics (#535)Glandos1-5/+25
* Align tables in statistics The table in sidebar is now aligned with the one in content, to avoid redundant informations. All tables are back to normal on small devices. * fix test * run black on tests
2020-02-17Use SQL statement for summing up weightsDavidRThrashJr1-0/+64
* Update models: Bill.pay_each() * Import sql func * reformatted using black * Added ModelsTestCase.test_bill_pay_each() in order to test the SQL query change within pay_each. Had to add Project.ProjectQuery.get_by_name() for the test.
2020-02-08Statistics view #323James Leong1-14/+4
Remove header and table column of 'Balance' in statistics view
2020-01-13Import previously exported json data (#518)Nicolas Vanvyve1-0/+209
Fix #417 * New tab upload * Extract data from JSON * Add users * Black format * Try to add bill * Import bills * Add french translation msg * Black reformat missing * Deactivated users are supported * Test import * Remove temp file in upload_json() * Incomplete tests * tests import * Update ihatemoney/translations/fr/LC_MESSAGES/messages.po Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com> * Remove useless variable and check json format * Use String.IO and test for wrong json * Remove coma Co-authored-by: Rémy HUBSCHER <hubscher.remy@gmail.com>
2019-12-29Fixed typos in tests.py (#521)John-Michael Reed1-4/+4
2019-10-25Token support (#504)José Antonio de la Torre1-0/+36
Added API support to generate authentication tokens, at `/api/projects/:id/token`
2019-10-19typoJosé Antonio de la Torre1-1/+1
2019-10-19Added testJosé Antonio de la Torre1-0/+40
2019-10-14Use black to refomat the files.Alexis M1-679/+921
2019-10-11Remove support for python2.Alexis M1-16/+11
In the same move : - use a setup.cfg file for packaging - remove the use of six
2019-10-03fix unit testsLeo Mouyna1-4/+14
2019-09-27Trim member usernames. Fixes #353Alexis Métaireau1-1/+10
2019-09-24Fix #434 Use the debts lib to solve settlements.Alexis M1-8/+13
2019-09-06Update requirements.txtAlexis M1-1/+1
2019-09-06bill list: add placeholder and disable add bill when no membersBrice Maron1-1/+27
2019-08-26Move export form to linksBrice Maron1-33/+7
2019-01-03Do not allow negative weights on users (Fixes #362) (#366)Alexis Metaireau1-0/+12
2019-01-03Provide basic math operations on bills (#413)Byron Ullauri1-0/+81
* allow basic math ops in amount field for bills form * docs: changing compile-translations to build-translations
2018-12-26Resolve "Update API project list" (#409)Byron Ullauri1-17/+8
* refactoring models _to_serialize property * updated project api members list * addressing flake8: line too long
2018-12-25Add CORS to the API. Fix #404 (#407)Alexis Metaireau1-0/+10
2018-12-25Add bill.creation_date field (#327)Lucas Verney1-3/+30
2018-09-03Add a ihatemoney delete-project command. (#375)Alexis Metaireau1-1/+11
2018-08-05Remove strict_slashes for /Glandos1-0/+6
I don't know why, but on my setup (nginx + uwsgi), the `strict_slashes` (default to `True`) was causing an infinite loop. I think it could be safely removed for this route only.
2018-02-07Add statistics support to APIJocelyn Delalande1-0/+34
2018-02-07Change statistics data structureJocelyn Delalande1-12/+12
Clearer data structure, and simpler template This commit has a side effect: sidebar now hides disabled members. IMHO, the disabled members should either be hidden or shown consistently between sidebar and central table. Previous status was: shown in sidebar (if balance ≠ 0) and hidden in central table.
2018-01-25API: Migrate from flask-rest to flask-restful (#315)0livd1-7/+7
The flask-rest custom json encoder is still needed and thus was added to ihatemoney's utils. Closes #298
2018-01-07manage commands testing (#313)JocelynDelalande1-0/+27
* Rename manage.ConfigTemplate → manage.GenerateConfig To be consistent with the CLI name: `generate-config`. * Add tests for manage.py commands * Run tests from pip-installed package To be able to detect packaging-related issues on test runs. refs #305
2017-12-29Allow to disable/enable member via API (#301)JocelynDelalande1-0/+24
Disable was already (kind-of) possible via API via DELETE, but not re-enabling. Kudos to @almet for helping me fixing that damn BooleanField :-)
2017-12-27Fix tests layout so that API tests are not ran twiceJocelyn Delalande1-6/+5
Bad inheritance was causing APITestsCase tests to be ran twice.
2017-12-27Add tests for #294Alexis Métaireau1-1/+7
2017-12-27 Fix PUT api/project/:code/members/:id (#297)JocelynDelalande1-2/+11
* Fix PUT api/project/:code/members/:id Before that commit, every PUT *must* change the name of the members, so that was : - no idempotence, - no ability to change only weight fix #295 * Remove redundant comment
2017-12-22Remove API password (#290)JocelynDelalande1-6/+16
* Remove the password from API GET responses While keeping it for POST/PUT. fix #289 * Add a test to check password change via API
2017-12-21Use hashed passwords for projects (#286)0livd1-11/+15
- Remove all occurences of clear text project passwords. - Migrate the database to hash the previously stored passwords. Closes #232
2017-12-15Use token based auth in invitation e-mails (#280)0livd1-0/+23
* Use token based auth in invitation e-mails Invitation e-mails no longer contain the clear text project password * Skip invite page after project creation - Replace ``The project identifier is demo, remember it!`` by ``Invite other people to join this project!`` (linking to the invite page) - Encourage users to share the project password via other communication means in the reminder email
2017-11-11Fix some typos using codespell (#285)Alexandre Avenel1-2/+2
2017-10-26Use token based auth to reset passwords (#269)0livd1-0/+24
Send a mail containing a password reset token link instead of sending a clear text password. Ref #232
2017-10-23Make authentication logic simpler and safer (#270)0livd1-2/+2
* Fixed exposed password in session The project password was set in clear text in the session cookie. The cookie payload is only base64 encoded so it must not be used to store private information. The password is simply replaced by a boolean. * Simplify authentication logic
2017-09-04Enhance the dashboard. (#262)0livd1-3/+28
* Update to a more flexible admin authentication * Admin can now access any project * Add delete and edit options in the dashboard * Add a link to the dashboard in the nav bar This is a rework of the changes proposed by @Olivd, so they can apply on top of the latest master without trouble. All credit goes to him for the code.
2017-08-21Add a statistics tab (#257)0livd1-0/+62