Commit graph

15 commits

Author SHA1 Message Date
sokumon
932d5ccc08 fix(test): fetch unseen notes 2025-04-21 19:12:46 +05:30
Ankush Menat
129212a916 perf: cache unseen notes 2025-01-14 19:43:22 +05:30
David Arnold
95950c8d81
refactor: organize test contextmanagers (#28041)
* refactor: prefer staticmethod decorator

* refactor: add cm register utility and keep cms in one file

* refactor: enter safe_exec enabled context (treewide)

* refactor: move trace fields to the other test context managers

* chore: marke all test_runner functions for deprecation

* chore: mark some tests.utils functions for deprecation (moved)

* chore: mark traced_field_conext for deprecation (moved)

* chore: placate semgrep in dumpster

* fix: show deprecation warnings per module in tests (incl. from dumpster)

* chore: remove use of deprecated functions from tests
2024-10-09 02:09:19 +02:00
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* 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
2024-10-06 09:43:36 +00:00
Ankush Menat
72c2207e0f refactor: useless use of dict in frappe.get_doc 2024-02-10 12:52:38 +05:30
Ankush Menat
6e0b522ae3 refactor!: Disable server scripts by default
- Move the config to bench level and not site level because, server
  script "threat model" requires consent from a bench owner and not
  individual site.
- While this is a breaking change which people may not like, we believe
  it's essential to improve security model of Frappe.
2023-08-23 14:49:05 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
6dcf12d509 fix: Apply permissions on Report sidebar
Alternate to https://github.com/frappe/frappe/pull/19588

Co-Authored-By: marination <maricadsouza221197@gmail.com>
2023-02-03 18:07:21 +05:30
Ankush Menat
75d092ef7d
Revert "fix: Report sidebar must consider Permission Query" (#19921) 2023-02-03 15:13:18 +05:30
Ankush Menat
13162d8fbd fix: Only apply perm query to non-admin users 2023-01-30 11:24:16 +05:30
marination
1e4d28cc19 fix(test): Remove try-finally & ignore perms on test user's report insertion 2023-01-30 11:08:14 +05:30
marination
968648e1b6 test: Test if permission query via server script is applied on cached allowed reports 2023-01-16 18:38:26 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Suraj Shetty
9e87598dda refactor: Use FrappeTestCase as it rolls back test data 2022-07-21 17:03:52 +05:30
Suraj Shetty
67350e9ac3 test: Add a test case to validate get_unseen_notes 2022-07-20 13:23:49 +05:30