Commit graph

28 commits

Author SHA1 Message Date
Sagar Vora
652cd169de fix(client): pass parent_doctype when fetching fields for child table links 2025-12-01 01:57:03 +05:30
Ankush Menat
063f2bbc79 fix: only check parent doctype for child doctypes 2025-02-06 13:05:06 +05:30
Ankush Menat
47af97661a test: avoid flaky behaviour on test ordering
If a test clears local.response and another test depends on it being
fresh inited then tests can fail.

E.g. response.docs might not exist.
2025-01-04 11:54:37 +05:30
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
bef9bdc5ee
fix: log out reliability (#25865)
* fix: Avoid possible cache eviction issue

Clear cache after removing data from DB, so a concurrent request can't put stale data in cache.

* fix: explicitly login as guest after logging out

Avoids problem with some other code potentially re-adding current
session in cache or DB.

* test: avoid hard coded admin pw

* test: reset user after running tests

* fix: only login as guest if in request

Background jobs, some other user disabling someone else etc
2024-04-09 18:56:52 +05:30
Ankush Menat
72c2207e0f refactor: useless use of dict in frappe.get_doc 2024-02-10 12:52:38 +05:30
Ankush Menat
970a740164
revert: #22308 (#22389)
* Revert "chore: move function to correct file"

This reverts commit ebfdfa283b.

* Revert "refactor!: merge get_site_url into get_url (#22308)"

This reverts commit 2001bc278f.
2023-09-13 14:34:52 +05:30
David Arnold
2001bc278f
refactor!: merge get_site_url into get_url (#22308)
* chore: merge get_site_url into get_url

* fix: keep alias with deprecation notice
2023-09-11 15:09:05 +05:30
David Arnold
011e44656b
fix(test): ensure tests construe the site url from its constructor (#21870) 2023-09-02 15:36:24 +05:30
barredterra
2e816ed68c fix: test_client_insert_many 2023-01-18 13:49:57 +01:00
Faris Ansari
aa8957e785
fix(insert_many): list instead of set to maintain order (#18641) 2022-10-28 14:37:17 +05:30
Faris Ansari
2b859990d2 test(client.delete): test for child doc delete 2022-10-18 14:15:37 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Ankush Menat
0686097de2
fix: get single doc using client.get (#17817) 2022-08-13 14:38:06 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
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
2022-07-01 11:51:05 +05:30
phot0n
0d9a6adcd9 test: test for insert_many client function 2022-05-11 23:59:21 +05:30
Faris Ansari
95816f0340 fix: better validation for child insert 2022-04-24 10:38:58 +05:30
Faris Ansari
112da07451 test: dict and JSON filters in client.get 2022-04-16 06:03:40 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Faris Ansari
7ef9a2554c test: web request with array values as params 2022-02-01 13:16:16 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* 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
2021-05-26 15:31:29 +05:30
Sagar Vora
6de2dfe2d9 test: remove unused import 2021-03-30 15:35:32 +05:30
Sagar Vora
3324f005b7 test: use frappe.local.attr instead of frappe.attr 2021-03-30 15:34:56 +05:30
Sagar Vora
528a7b0f30 test: add test to ensure run_doc_method works as expected 2021-03-30 15:08:05 +05:30
Saurabh
a0086db9b6
fix(frappe client): validate http method for frappe.client api (#11228) 2020-09-14 12:30:30 +05:30
Achilles Rasquinha
abb7f14bbd self.assertEqual 2018-02-28 21:19:01 +05:30
Makarand Bauskar
6fa9967a04 [hotfix] throw DoesNotExistError if doctype is not available on Delete api (#4013)
* [hotfix] throw DoesNotExistError if doctype is not available on Delete api

* [fixes] aded tests cases and codecy, travis fixes
2017-09-01 09:16:32 +05:30
Rushabh Mehta
89a77016a5 [minor] dont show disabled roles in permission manager (#2180) 2016-10-25 10:59:41 +05:30