Commit graph

45 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ó e2c9ea3cd2 Fix instances of bad-classmethod-argument in recently edited files 2024-03-17 21:28:55 -03:00
Adeodato Simó 4b9fe0af0c Remove nesting in several with..patch calls 2024-03-17 20:57:39 -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
Josh Soref 63dbb6a291 spelling: successfully
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Christof Dorner 11640f986e Import hashtags from activitypub statuses 2023-03-07 12:59:31 +01:00
Hugh Rundle f8c9df4aff pylint fixes 2023-01-20 18:20:18 +11:00
Hugh Rundle 0da5473b0c black formatting 2023-01-20 16:31:27 +11:00
Hugh Rundle 9a0f8f9c2a fix test_get_representative_not_existing params 2023-01-19 16:40:13 +11:00
Hugh Rundle d66e2fe861 merge in latest changes 2023-01-18 14:12:01 +11:00
Mouse Reeve ddcaf8e3b8 Use asyncio for broadcasting 2022-11-10 15:41:56 -08:00
Mouse Reeve 8cc4427e60
Merge branch 'main' into misc/add_signatures_to_requests_for_masto_compat 2022-01-13 11:37:54 -08:00
Renato "Lond" Cerqueira e2ee3d27a7 WIP 2022-01-05 15:47:05 +01:00
Mouse Reeve 5e6b28bbc0 Prefs mocks 2021-12-09 20:30:53 -08:00
Mouse Reeve e6a251fdad Updates mocks across tests 2021-11-12 10:07:38 -08:00
Mouse Reeve 72d5238590 More mocks 2021-09-06 14:50:33 -07:00
Mouse Reeve bb94995389 Where you need one mock, you probably need the other 2021-09-06 14:48:45 -07:00
Mouse Reeve a6b0ba1826 Updates activistreams add_status mock 2021-09-06 13:53:49 -07:00
Mouse Reeve ebc0680288 Fixes logic error in detecting changed fields when serializing 2021-08-03 12:21:11 -07:00
Mouse Reeve b059cbdd18 Adds missing import and mock 2021-08-03 12:02:47 -07:00
Mouse Reeve a84a744e8d Track changed fields in activity to model code 2021-08-03 08:48:15 -07:00
Mouse Reeve 6d8bced0f1 Refactors test mocks 2021-08-02 16:05:40 -07:00
Joachim f8df501239 Fix tests (for realz) 2021-05-27 23:19:17 +02:00
Joachim 2ea1cd8319 Tests 2021-05-26 23:57:29 +02:00
Mouse Reeve 3ade2d3bb1 New version of black, new whitespace 2021-04-26 09:15:42 -07:00
Mouse Reeve 9e23bfe7c0 Updates activitypub tests 2021-03-23 10:25:52 -07:00
Mouse Reeve bb8ce74f52 Updates base activity tests for updated Image type 2021-03-15 15:57:00 -07:00
Mouse Reeve 70296e760b Runs black 2021-03-08 08:49:10 -08:00
Mouse Reeve 410e0b04bb Fixes fav logic and base activity test 2021-03-07 13:13:16 -08:00
Mouse Reeve 77781d57c3 Fixes base activity tests 2021-02-16 20:24:37 -08:00
Mouse Reeve a9ca3a4290 Fixes calls to to_model, init with activitypub partially serialized 2021-02-16 20:17:38 -08:00
Mouse Reeve 3f61675a0a Updates usage of resolve_remote_id 2021-02-16 19:35:43 -08:00
Mouse Reeve 76e90cb3f6 Fixes remaining test patches 2021-02-08 09:38:28 -08:00
Mouse Reeve 7e987fc446 Updates unit tests for new username handling
still some failing tho
2020-12-27 17:21:01 -08:00
Mouse Reeve 79973687d5 Updates tests 2020-12-20 12:50:35 -08:00
Mouse Reeve 44cbf7c07f Fixes checking privacy when serializing status 2020-12-13 14:35:56 -08:00
Mouse Reeve e7f400533e Fixes missing book and user objects 2020-12-12 14:15:10 -08:00
Mouse Reeve 7c43fa1f7c Adds deduplication fields 2020-12-12 13:39:55 -08:00
Mouse Reeve 6b9db97ab8 tests set_related_field 2020-12-09 13:11:42 -08:00
Mouse Reeve 4d4ee8b8c3 Starts getting reverse fields working for deserialization
also fixes the fields on the image model and runs a long overdue
migration
2020-12-07 18:28:42 -08:00
Mouse Reeve 0a576c325c Fixes deserializing tags of varied types 2020-12-07 13:16:42 -08:00
Mouse Reeve 6817babf3c adds some tests for to_model 2020-12-07 12:19:15 -08:00
Mouse Reeve f61fcb1261 Adds tests for resolve_remote_id 2020-12-07 10:46:41 -08:00
Mouse Reeve 74ac8d60f8 Starts adding tests for base_activity
includes init and find_existing_by_remote_id
2020-12-07 10:32:31 -08:00