* refactor: constitute unit test case
* fix: docs and type hints
* refactor: mark presumed integration test cases explicitly
At time of writing, we now have at least two base test classes:
- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase
They load in their perspective priority queue during execution.
Probably more to come for more efficient queing and scheduling.
In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.
* feat: Move test-related functions from test_runner.py to tests/utils.py
* refactor: add bare UnitTestCase to all doctype tests
This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
* fix: review points when added more then once.
previously when user added review more then once it didn't work properly
because of apply_only_once check which is only meant for rule based points
changed that behaviour to only check when called from energy_point_rule by checking if doc.rule is set.
Fix conditions to bother only those who asked for the data:
- Clear permissions cache only for updated users' data
- Defer appropriate events until commit to avoid ghost events
- Remove event unused by desk (and other apps)
These events were added for supporting listeners in desk. The listeners
have thus been removed and these are now unnecessary messages published
to anyone landing on Frappe pages or on Desk.
- reference owner - only used for activity page which is unusable
*anyway*
- same for timeline and link doctypes
perf: drop unused index from Commment
Can't find a single query that uses this index
perf: drop pointless "Is home folder" index
just why? It's checkbox index with 1 entry which has unique name already
Most pointless index I've seen no far.
perf: Drop "attached to doctype" separate index
There is already a composite index for this.
perf: drop indexes from web page view log
BOTH are totally unused in any of the queries related to this doctype.
Only "website analytics" report uses this which doesn't even show this
data lmao.
perf: drop unused index from EPS log
We never filter by doctype or type. pointless indexing.
perf: fix up notification log indexes
- drop unused index
- add "for user" index
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
* feat: utility methods for docstatus
* refactor: use utility method for doctsatus
* refactor: enum for docstatus
* refactor: docstatus as property
* fix: set docstatus
* feat: docstatus extends int class
* test: docstatus of BaseDocument
* refactor: occurrences of docstatus
* fix: typo
* refactor: move docstatus to a separate file
* test: docstatus
* fix: sider
Removed "Track Changes" from:
- Activity Log
- Error Log
- Error Snapshot
- Scheduled Job Log
- View Log
- Notification Log
- Route History
- Energy Point Log
- Web Page View
These documents dont change and even if they did it's useless to keep
track of it IMO. Removing this speeds up insertion and saves storage.
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass