Commit graph

45 commits

Author SHA1 Message Date
Bart Schuurmans
f24fdf73b5 Update to match newer code style 2024-04-24 15:08:48 +02:00
Bart Schuurmans
839ab2fafd
Merge branch 'main' into move-fix 2024-04-24 14:56:32 +02:00
Hugh Rundle
6684d60526
refactor Move for more redundancy
As outlined in #3354, a use `Move` fails if the user is moving from a BookWyrm server to another BookWrym server.
This is because:

1. the original code did not announce changes to alsoKnownAs;
2. the original code always checked the locally saved profile rather than refetching the remote data;

This commit fixes both these problems by forcing `MoveUser` to always perform a "refresh" of the local data from the remote, and by saving the user with broadcast=True when updating alsoKnownAs ids.
2024-04-22 13:35:08 +10:00
Hugh Rundle
d48d312c0a
Merge branch 'main' into user-export 2024-04-13 12:26:13 +10:00
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
Bart Schuurmans
0ac9d12d1c Merge branch 'main' into user-export 2024-03-29 14:23: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ó
1b9e0546e6 Bracket-wrap calls to patch() for better readability 2024-03-17 20:34:12 -03:00
Hugh Rundle
765fc1e43d
fix tests 2024-01-29 12:28:37 +11:00
Hugh Rundle
2c231acebe
linting and tests 2024-01-28 20:35:47 +11:00
Carlos Camara
ddbda3ab9c Fix test_export 2024-01-16 08:12:59 +00:00
Carlos Camara
854eb36618 Export bookshelves and review date 2024-01-13 16:47:51 +00:00
Carlos Camara
93cab480d6 Code format 2024-01-06 09:50:14 +01:00
Carlos Camara
ebcc81dd73 Revert changes to default book
These changes were introduced by mistake in my previous commit.
2024-01-04 11:33:26 +01:00
Carlos Camara
30c9ec9611 Prevent lint error
See @hughrun 's explanation https://github.com/bookwyrm-social/bookwyrm/pull/3189#issuecomment-1876145423
2024-01-04 11:28:17 +01:00
Carlos Camara
ae5950f187 Add readthrough fields to text_export.py 2024-01-04 11:10:38 +01:00
Mouse Reeve
ca79cb1ca7
Merge pull request #3054 from bookwyrm-social/user-migration
User migration via export file
2024-01-01 19:04:43 -08: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
Hugh Rundle
fd1ebf5f71
formatting and pylint fixes 2023-10-22 16:52:29 +11:00
Hugh Rundle
a4bfcb34d5
fix tests and clean up
* cleans up some test logging
* cleans up some commented-out code
* adds export_job model tests
* reconsiders some tests in export user view tests
2023-10-15 15:09:19 +11:00
CSDUMMI
688978369f Implement self-contained archives to import and export entire users between instances (#38)
Co-authored-by: Daniel Burgess <developerdannymate@gmail.com>
Co-authored-by: Hugh Rundle <hugh@hughrundle.net>
Co-authored-by: dannymate <dannymate@noreply.codeberg.org>
Co-authored-by: hughrun <hughrun@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/GuildAlpha/bookwyrm/pulls/38
Co-authored-by: CSDUMMI <csdummi.misquality@simplelogin.co>
Co-committed-by: CSDUMMI <csdummi.misquality@simplelogin.co>
2023-09-07 22:37:28 +02:00
Mouse Reeve
a7e6919b96 Fixes confirm email slow and adds test 2023-07-16 05:55:38 -07:00
Wesley Aptekar-Cassels
50a81bdfdd Change CSV export to buffer instead of streaming
The idea behind a streaming CSV export was to reduce the amount of
memory used, by avoiding building the entire CSV file in memory before
sending it to the client. However, it didn't work out this way in
practice: the query objects that were created to represent each line
caused Postgres to generate a very large (~200MB on bookwyrm.social)
temp file, not to mention the memory being used by the Query object
likely being similar to, if not larger than that used by the finalized
CSV row.

While we should in the long term run our CSV exports as a Celery task,
this change should allow CSV exports to work on large servers without
causing disk-space problems.

Fixes: #2157
2023-03-08 21:37:56 -05:00
Jascha Urbach
ac8b060d58
Isfdb ID for books and authors (#2482)
* New ID: Audible ASIN

Audible belongs to Amazon BUT they do not share the same IDs. The Audible ASIN of an audiobook is never the same as the Amazon ASIN.

Yeah, I know, Amazon is great. The fact that the ASIN is a good distinction for different works and editions bothers me more than I will ever be willing to admint.

* New ID "ISFDB"

Internet Speculative Ficiton Database ID for books and authors.
Links to the entry if set.

* Added aasin to test

Added aasin to test

* the answer expects more emptxy fields...
2022-12-11 11:33:33 -08:00
Mouse Reeve
eae1866992
Allow users to temporarily deactivate their accounts (#2324) 2022-11-10 13:40:54 -08:00
Hugh Rundle
905aa66f38 add test_post_login_with_2fa 2022-10-15 07:47:20 +11:00
Hugh Rundle
119b4bf2ff clean up tests
- remove unnecessary crap
- add missing tests
2022-10-15 07:47:20 +11:00
Hugh Rundle
9d36722783 code formatting 2022-10-15 07:47:20 +11:00
Hugh Rundle
b63d4bec60 add tests for 2fa 2022-10-15 07:47:20 +11:00
Mouse Reeve
1bb0a9d998 Updates tests 2022-07-15 11:18:47 -07:00
Mouse Reeve
659ee96002 Use password validation in change password flow
This also moves the form validation into a form instead of doing it in
the view.
2022-07-15 10:51:58 -07:00
Mouse Reeve
f1ae64543f
Merge pull request #2216 from bookwyrm-social/export-post
Use HTTP post for CSV export
2022-07-11 08:14:47 -07:00
Mouse Reeve
9104d1f8db Fixes reference to renamed view 2022-07-11 08:05:32 -07:00
Mouse Reeve
42e29e40b3 Use HTTP post for csv export
Also fixes a missing translation string
2022-07-11 07:51:51 -07:00
Mouse Reeve
a0e01af2ca Updates tests 2022-07-10 20:22:54 -07:00
Mouse Reeve
a92bf785dd Updates init files for pylint 2022-04-08 14:16:05 -07:00
Mouse Reeve
5e6b28bbc0 Prefs mocks 2021-12-09 20:30:53 -08:00
Mouse Reeve
d9d0919ad4 More mocks for more tests 2021-12-09 19:14:10 -08:00
Mouse Reeve
e6a251fdad Updates mocks across tests 2021-11-12 10:07:38 -08:00
Mouse Reeve
bdb1d1998a Helper function for html validation 2021-09-30 22:22:20 -07:00
Mouse Reeve
afcd296513 Test rendered html 2021-09-28 13:44:49 -07:00
Mouse Reeve
6266b58650 Updates static paths in tests 2021-09-28 12:02:09 -07:00
Mouse Reeve
c5d7c7dbff Updates block view path reference in test 2021-09-28 11:49:53 -07:00
Mouse Reeve
a9eb544bac Moves blocks views and tests into preferences dir 2021-09-28 11:44:53 -07:00
Mouse Reeve
461f834973 Move preferences test into their own directory 2021-09-28 11:41:40 -07:00