Anki/pylib/tests
Damien Elmes ce243c2cae Simplify note adding and the deck/notetype choosers
The existing code was really difficult to reason about:

- The default notetype depended on the selected deck, and vice versa,
and this logic was buried in the deck and notetype choosing screens,
and models.py.
- Changes to the notetype were not passed back directly, but were fired
via a hook, which changed any screen in the app that had a notetype
selector.

It also wasn't great for performance, as the most recent deck and tags
were embedded in the notetype, which can be expensive to save and sync
for large notetypes.

To address these points:

- The current deck for a notetype, and notetype for a deck, are now
stored in separate config variables, instead of directly in the deck
or notetype. These are cheap to read and write, and we'll be able to
sync them individually in the future once config syncing is updated in
the future. I seem to recall some users not wanting the tag saving
behaviour, so I've dropped that for now, but if people end up missing
it, it would be simple to add as an extra auxiliary config variable.
- The logic for getting the starting deck and notetype has been moved
into the backend. It should be the same as the older Python code, with
one exception: when "change deck depending on notetype" is enabled in
the preferences, it will start with the current notetype ("curModel"),
instead of first trying to get a deck-specific notetype.
- ModelChooser has been duplicated into notetypechooser.py, and it
has been updated to solely be concerned with keeping track of a selected
notetype - it no longer alters global state.
2021-03-10 11:53:27 +10:00
..
support tweaking the folder names again 2020-01-03 07:48:38 +10:00
__init__.py tweaking the folder names again 2020-01-03 07:48:38 +10:00
run_format.py Update mypy and black format check to python version 3.8 2020-11-11 09:24:28 +00:00
run_mypy.py initial Bazel conversion 2020-11-01 14:26:58 +10:00
run_pylint.py initial Bazel conversion 2020-11-01 14:26:58 +10:00
run_pytest.py implement fuzzing 2021-02-22 21:31:53 +10:00
shared.py fix errorsAfterMidnight 2020-04-08 10:05:19 +10:00
test_cards.py make backend instance on col private 2021-01-31 18:56:16 +10:00
test_collection.py Simplify note adding and the deck/notetype choosers 2021-03-10 11:53:27 +10:00
test_decks.py move drag/drop deck logic to backend 2021-01-31 13:46:31 +10:00
test_exporting.py rework v2 scheduler upgrade; drop downgrade 2021-02-21 15:50:41 +10:00
test_find.py undo support for bulk tag add/remove 2021-03-10 11:47:53 +10:00
test_flags.py make flag changes in the reviewer undoable 2021-03-10 11:53:27 +10:00
test_importing.py make mark toggling undoable 2021-03-10 11:53:27 +10:00
test_latex.py remove print statement from unit tests 2020-11-18 13:56:44 +10:00
test_media.py Merge pull request #793 from nwwt/object-audio-tags-support 2020-11-11 10:33:31 +10:00
test_models.py make mark toggling undoable 2021-03-10 11:53:27 +10:00
test_sched2021.py use different approach to running tests twice 2021-03-01 12:47:39 +10:00
test_schedv1.py make flag changes in the reviewer undoable 2021-03-10 11:53:27 +10:00
test_schedv2.py switch to 4 buttons when previewing in test scheduler 2021-03-01 23:47:00 +10:00
test_stats.py d->col in tests 2020-07-17 06:58:32 +02:00
test_template.py d->col in tests 2020-07-17 06:58:32 +02:00
test_undo.py commit immediately when there's no active checkpoint 2021-03-10 11:47:53 +10:00