* 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
Drop mandatory, assume sane defaults
The current implementation broke old users of redirects like helpdesk app
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
| Metric | Before | After | Change |
| --- | --- | --- | --- |
| app.html first response size | 421kb | 106kb | -75% (!) |
| First response duration | 60ms | 40ms | -33% |
huge thanks to @cogk for doing most of the work for this PR on this issue: https://github.com/frappe/frappe/issues/17449#issuecomment-1728328726
Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
* feat: Add custom icons with the `app_include_icons` hook
These custom icons are available on the desk only. They can be picked in the `ControlIcon` picker.
Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>
* fix: skip conf for including icons
* test: Fix test_include_icons
---------
Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
`frappe.local.request` was not cleared between tests, which would not be a problem if all tests did set it to another Request object. But, some tests directly fetch the response content using get_response_content without first setting the frappe.local.request object (using set_request).
This test code never actually tested the behaviour for two reasons:
- first, the page had an error which meant that a 500 Error page was returned (because `path` is not a string)
- second, every page contains the string "400" because it's contained in some of the icons.svg icons!
I also found a minor related bug in static_page.py, allowing people to download PYC files (pycache)
* Handle inconsistencies in type handling in DatabaseQuery & Database
APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests
fix: db independent syntax for user_type
fix: handle postgres datetime values
feat: add ability to auto commit on db inserts
feat: add ability to escape underscore in postgres
fix: handle missing data in test runner bootstrapping
fix: db independent syntax for queries
fix: refactor to use qb
fix: update cache for language
fix: use pluck in email_queue
Co-authored-by: gavin <gavin18d@gmail.com>
fix: don't auto insert on tests for make_property_setter
fix: remove auto_commit in custom_field insertion
fix: remove auto_commit functionality
fix: review comments
fix: revert link validation
fix: style suggestion for readability
Co-authored-by: gavin <gavin18d@gmail.com>
fix: revert .lower() in link validation
fix: add rollback for setup_wizard
Revert "fix: add rollback for setup_wizard"
This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.
Revert "feat: add ability to escape underscore in postgres"
This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.
fix: more concise representation of order fields
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