* 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
* refactor!: Drop handling for SQL queries
This hasn't been supported in really long time, no need to check that
use cases.
It will still fail but with no special error message.
* fix: Catch all import related errors
* fix!: Use last query from hooks
* refactor!: Return search results like any other function
Search results are returned in `results` key which is incosistent from
most other functions
* refactor: simplify search_link
Meta order in most cases is default "modified" which doesn't quite help.
idx is # of times a document is referred to somewhere else, which is
more likely to be relevant.
When `locate` returns 0 it's shown on top instead it should be shown
last or not shown at all.
This is math hack to avoid using any complex SQL functionality which
isn't allowed in DB query.
* refactor: rename poorly named functions
* refactor: getting translation from apps
- use generator
- use sane name for cache key
- avoid manual handling of frappe.local state just use cache() interface
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.
* fix: only enabled users in mentions
* Update frappe/desk/search.py
Co-authored-by: gavin <gavin18d@gmail.com>
* test: add test cases to disallow disabled in mention
* test: pass roles as single values
* style: Remove extra space and line
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: gavin <gavin18d@gmail.com>
* 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
* Doctype search in foreign language
* List comprehension slightly faster
* Remove obsolete comment
* Remove trailing whitespace
* Test case for address and contact query
* Refactor search and add tests
* Travis test debug
* Remove debug print
* Search limit removal for untranslated docs and tests refactor
* Remove old comments
* Test modification for Travis
* remove unused import
* Correct Role doctype