Commit graph

1671 commits

Author SHA1 Message Date
Sagar Vora
9ad9c39d25 test: improve doctype and field naming 2022-12-17 07:56:54 +00:00
Sagar Vora
6fe9f9b411
test: remove duplication in test_search 2022-12-16 10:21:50 +05:30
Ankush Menat
c0e5408659
Merge pull request #19277 from resilient-tech/refactor-sanitize_searchfield
fix: use stricter regex for `sanitize_searchfield`
2022-12-15 17:47:07 +05:30
Ankush Menat
9b2283092e test: another test case for index duplication 2022-12-15 14:11:26 +05:30
Gavin D'souza
4fe260e09e refactor: transform_parameter_types
- Switch to Pydantic which is under continuous development and can
  support more types
- Equivalent Pydantic API will try to transform data if possible
- The previous point makes it such that we don't need to explicitly try
  to parse each stringified int in app code since Pydantic can do this
- Drop typeguard since it did not handle 3.10+ native typing definitions
2022-12-15 13:47:05 +05:30
Gavin D'souza
73b0971a26 test: Add tests for typing validations 2022-12-15 13:47:05 +05:30
Gavin D'souza
3aa1d61f0d fix(whitelisted)!: Raise TypeError instead of ValidationError for unaccepted param types 2022-12-15 13:47:05 +05:30
Ankush Menat
e437d0aca2 test: test index after col change too 2022-12-15 13:39:25 +05:30
Ankush Menat
8df845ca35 fix: duplicate unique index when column is altered 2022-12-15 13:36:28 +05:30
Ankush Menat
d27ea5e6da test: unique index on install and alter
There should always be 1 unique index.
2022-12-15 13:36:28 +05:30
Daizy Modi
9a8dbc42a7 fix: added a case with backticks 2022-12-14 17:01:19 +05:30
Daizy Modi
3e824a9ea5 test: test case for sanitize_searchfield 2022-12-14 16:47:23 +05:30
Ankush Menat
2b050f9fc3 test: test without adding hacky flags 2022-12-14 15:46:46 +05:30
Ankush Menat
ee5c82e985 fix(DX): validate virtual doctype controllers 2022-12-13 14:18:19 +05:30
Ankush Menat
ec3f705e4f
feat: finer frappe Recorder control with decorator (#19220)
Currently frappe recorder can be enabled globally and profiles every
request. This is often way too much info. If you already know where
problem lies you use this decorator sparingly to only profile relevant
functions.

Usage:
```py
from frappe.recorder import record_queries

@record_queries
def sus_slow_function():
    frappe.db.sql("select everything from everywhere")
```
2022-12-09 14:18:49 +05:30
Ankush Menat
442ba5dbf2
fix: set-config -g (#19217)
This isn't working because it uses update_site_config command which
attemts to find site_dir to create a lock which doesn't work when site
isn't init-ed.
2022-12-09 11:10:09 +05:30
Shariq Ansari
8b0736d07c
Merge pull request #19098 from resilient-tech/check-parentfield-valid 2022-12-08 12:19:51 +05:30
Sagar Vora
7d47d10692 fix: override RestrictedPython transformer to allow _dict, revert frappe.as_dict 2022-12-07 13:45:28 +05:30
Sagar Vora
10695d3d49 feat: make context optional when calling render_template 2022-12-07 13:32:38 +05:30
Sagar Vora
f2e1dbe7eb fix: restore _dict, used in Jinja code 2022-12-07 13:13:27 +05:30
Ankush Menat
d389fffbb7
feat: inter-process file locks (#19133) 2022-12-06 16:31:51 +05:30
Sagar Vora
481ff1b2af test: add testcases for parentfield validations 2022-12-04 20:06:26 +00:00
Raffael Meyer
c7ef28fa0c
fix: don't validate to & from dates if any one is missing in validate_from_to_dates (#19079) 2022-12-03 18:32:59 +05:30
Ankush Menat
7d52df875f
perf(install): bulk insert country and currencies (#19084) 2022-12-03 12:03:05 +05:30
Ankush Menat
442060a96a
Merge pull request #17150 from ankush/bulk_object_inserts
feat: bulk insert simple Docs and iterator support for db.bulk_insert
2022-11-29 13:33:25 +05:30
Ankush Menat
7a3faf23e1
Merge pull request #18664 from barredterra/csv-params
feat: configurable CSV delimiter and quoting
2022-11-29 13:27:24 +05:30
Ankush Menat
465b3f6968 test: use _dict in tests
form_dict is usually _dict, otherwise some unrelated tests will fail.
2022-11-29 11:53:52 +05:30
barredterra
2c0827dda9 fix: test reportview 2022-11-28 12:16:18 +01:00
Ankush Menat
a6af1ed542 feat: bulk insert simple Document objects 2022-11-28 15:32:20 +05:30
gavin
6062d812a1
fix(db_query): Disallow usage of certain functions in *_by (#18981)
* fix(db_query): Disallow blacklisted functions in (order|group)_by

Changes:
- allow only functions that are not blacklisted in *_by clause:
  currently just sleep
- perf improvemnts: lower, in, split, strip & other low hanging  micro optimizations

Handle the following use cases:
- upper/lower case function usages
- spaces between function name and brackets

* test(db_query): Add tests for *_by checks
2022-11-28 12:42:29 +05:30
Raffael Meyer
83e2f524e2
Merge branch 'develop' into csv-params 2022-11-26 20:10:51 +01:00
barredterra
839de22d95 feat: add test for exporting reportview as CSV 2022-11-26 20:01:48 +01:00
Gavin D'souza
1a5e5f546b fix: Move function check inside subquery 2022-11-24 16:27:54 +05:30
Gavin D'souza
1f913248aa test: Add more tests for illegal subquery and fn usage 2022-11-24 15:36:31 +05:30
Sagar Vora
6e896aa412 fix: decorator usage 2022-11-21 17:17:18 +05:30
marination
4cd80bd279 fix: Avoid caching unsaved documents and secure whitelist decorator
- Avoid caching documents like 'new-item-1', default to doctype perms instead
- Use secure `whitelist_for_tests` decorator instead
2022-11-21 16:41:37 +05:30
Marica
eec7a7fd13
Merge branch 'develop' into get_role_permissions-js-consistency 2022-11-21 14:03:17 +05:30
marination
ed2804d1c5 test: Cypress test to check basic has_perm and get_perm JS APIs
- Test removes System Manager role for user and expects certain perms
- On Kanban Board DocType, only System Manager is allowed to print/export/email/report/share
- DocType level test only
2022-11-21 13:41:04 +05:30
Faris Ansari
74bce62c62
Merge pull request #18841 from netchampfaris/app-include-site-config 2022-11-17 21:13:11 +05:30
Ankush Menat
f488a4953f
chore: validate ui test helpers at runtime (#18922)
[skip ci]
2022-11-17 18:17:22 +05:30
Faris Ansari
e10d19a317
Merge branch 'develop' into app-include-site-config 2022-11-15 17:19:59 +05:30
Ankush Menat
9b90e620bc chore: disable flaky test
This is
- flaky
- difficult to find source of flake because of crazy tests
- adds little value tbh

[skip ci]
2022-11-15 17:17:10 +05:30
Faris Ansari
cfc2dd4437 test: patch get_hooks to bypass cache 2022-11-15 14:50:38 +05:30
Raffael Meyer
cca25174ab
Merge branch 'develop' into csv-params 2022-11-14 12:38:51 +01:00
Ritwik Puri
518b7e1c66
Merge pull request #18251 from Aradhya-Tripathi/bg-submissions
feat: Background submissions for submittable doctypes
2022-11-12 20:06:57 +05:30
Aradhya
3759e5bbcd refactor: lint
fix: removed time.sleep
2022-11-12 20:06:17 +05:30
Ankush Menat
6c01d1d417 refactor: hmac generation
Reduce code duplication
2022-11-12 13:05:57 +05:30
Aradhya Tripathi
07bd958dfd
Merge branch 'develop' into bg-submissions 2022-11-12 08:37:55 +05:30
Faris Ansari
e0a725025c test: for app_include_js and app_include_css 2022-11-11 20:47:18 +05:30
Ankush Menat
a7377d23fc
refactor!: Drop deprecated functionality (#18815) 2022-11-11 19:54:36 +05:30