Commit graph

38 commits

Author SHA1 Message Date
Bart Schuurmans ffee29d8e2 Fix resource leaks
Rewrite places where files (or other resources) are opened but not closed to "with" blocks, which
automatically call close() at the end of the scope.

Also simplify some tests where images need to be saved to a model field: an opened file can be
passed directly to FileField.save().
2024-03-29 20:14:10 +01:00
Adeodato Simó 90bd893568 Fix remaining instances of bad-classmethod-argument 2024-03-17 21:28:55 -03:00
Adeodato Simó 9d502f5ee2
Use setUpTestData() to speed up tests
Pylint's `bad-classmethod-argument` is disabled for each definition
to avoid rewriting the method bodies just to rename `self` → `cls`.
This can be done gradually, as the setUpTestData methods are modified
along the way.
2023-12-11 19:40:30 -03:00
Mouse Reeve f839038c8f Add test for normalizing isbns in book model
Turns out this was actually working as expected
2023-11-02 19:12:46 -07:00
Adeodato Simó 7cfdf235bc
Include author in cover image alt text 2023-09-25 16:03:16 -03:00
Mouse Reeve eae06602a9 Fixes test data 2023-07-21 14:38:28 -07:00
Mouse Reeve ccf3a4c5c1 Skip trying to match editions
It's rare that it will be useful, and it was a huge hassle.
2023-07-18 19:33:39 -07:00
Mouse Reeve 8b88de624d Adds test and fixes logic errors 2023-07-17 20:00:45 -07:00
Zach Flanders f43d7f8c70 fixing test and other checks 2023-04-25 21:00:16 -05:00
Zach Flanders 575e1bac4c responding to review comments 2023-04-25 19:46:38 -05:00
Zach Flanders 6b39052fcc Adding test for sort_title population 2023-04-25 07:17:23 -05:00
Arie van Deursen 2bf8cd88f1
Fix @pytest.mark.skipif formatting 2022-12-30 18:44:28 +01:00
Arie van Deursen 1c0a3a7829
Only test thumbnails if they're enabled in the settings 2022-12-26 14:26:23 +01:00
Mouse Reeve 1a082b5ee8 Settings 2022-07-07 11:37:34 -07:00
Mouse Reeve 634ed50044 Tests for image generator file
This isn't what I need to be working on right now but it bugs me
immensely that the test coverage is at 89% and not 90% and this was the
lowest hanging fruit to get more coverage. Truly a me problem.
2022-07-07 10:24:19 -07:00
Mouse Reeve c06817e9ff Python formatting 2022-02-09 12:23:01 -05:00
Mouse Reeve 288c396c49 Removes test line 2021-12-10 13:45:50 -08:00
Mouse Reeve 3fb9d140ed Fixes typo in test 2021-12-10 13:39:41 -08:00
Mouse Reeve d28b22a361 Adds test for generated links in book model 2021-12-10 13:33:00 -08:00
Mouse Reeve 6d8bced0f1 Refactors test mocks 2021-08-02 16:05:40 -07:00
Mouse Reeve 68fc5f2b5a Trigger search vector update when author is edited 2021-06-26 12:34:05 -07:00
Joachim 2ea1cd8319 Tests 2021-05-26 23:57:29 +02:00
Mouse Reeve 6551c59c45 Don't store default edition in the dataase 2021-04-28 16:05:17 -07:00
Mouse Reeve 3ade2d3bb1 New version of black, new whitespace 2021-04-26 09:15:42 -07:00
Mouse Reeve 70296e760b Runs black 2021-03-08 08:49:10 -08:00
Mouse Reeve b70e728ffb Removes the word "cover" from cover alt text
Fixes #694
2021-03-05 06:58:22 -08:00
Mouse Reeve 83852e29eb Update edition ranks when work is saved 2021-01-11 10:02:49 -08:00
Mouse Reeve 60239c867a Updates unit tests 2020-12-17 13:06:17 -08:00
Mouse Reeve 530198adea Serialize alt text of images 2020-12-17 12:54:04 -08:00
Mouse Reeve 39dc0501a5 Make alt text a model property 2020-12-17 12:30:49 -08:00
Mouse Reeve badc5d0dab Adds another shelf model test 2020-12-14 10:18:14 -08:00
Mouse Reeve 646ced80ce Test fixes 2020-12-03 17:18:23 -08:00
Mouse Reeve 86504989b4 fixes import matching with local books 2020-11-13 09:59:57 -08:00
Mouse Reeve cfa4cb015d corrects tests for latest code changes 2020-11-07 17:48:50 -08:00
Mouse Reeve 3fc1f46897 Handle dashes in isbns 2020-10-30 12:43:02 -07:00
Mouse Reeve 7febcec229 convert between ibsn 10 and 13 2020-10-29 12:32:37 -07:00
Mouse Reeve c7883cd615 Updates migrations
To get the app working again I ran resetdb, let it crash in initdb,
then ran the migration, then re-ran initdb
2020-09-21 08:10:37 -07:00
Mouse Reeve f77c156733 rename main code directory 2020-09-17 13:30:54 -07:00
Renamed from fedireads/tests/models/test_book_model.py (Browse further)