Commit graph

9 commits

Author SHA1 Message Date
Adeodato Simó e2c9ea3cd2 Fix instances of bad-classmethod-argument in recently edited files 2024-03-17 21:28:55 -03:00
Adeodato Simó 1b9e0546e6 Bracket-wrap calls to patch() for better readability 2024-03-17 20:34:12 -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
Wesley Aptekar-Cassels 2a5f722f6e Optimize add/remove book statuses task queries
The queries as they previously existed required joining together 12
different tables, which is extremely expensive. Splitting it into four
queries means that the individual queries can effectively use the
indexes we have, and should be very fast no matter how many statuses are
in the database.

Removing the .distinct() call is fine, since we're adding them to a set
in Redis anyways, which will take care of the duplicates.

It's a bit ugly that we now make four separate calls to Redis (this
might result in things being slightly slower in cases where there are an
extremely small number of statuses), but doing things differently would
result in significantly more surgery to the existing code, so I've opted
to avoid that for the moment.

Fixes: #2725
2023-03-09 15:26:03 -05:00
Mouse Reeve 224dc4100a Activitstreams tests 2022-01-28 17:32:41 -08:00
Mouse Reeve 0c193b6ce1 ActivityStream mocks 2021-12-09 20:33:11 -08:00
Mouse Reeve e6a251fdad Updates mocks across tests 2021-11-12 10:07:38 -08:00
Mouse Reeve da3bc1e591 Python formatting 2021-09-07 12:05:34 -07:00
Mouse Reeve d147c6ac2f Separate tests into more files 2021-09-07 11:13:18 -07:00