Commit graph

27 commits

Author SHA1 Message Date
Faris Ansari
d33b1ac695 chore: formatting 2024-12-02 13:40:16 +05:30
Faris Ansari
3b014a2548 test: rename autoincrement document 2024-11-30 16:49:04 +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
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
3005e66e45 refactor!: Drop previously deprecated code 2023-06-13 16:00:43 +05:30
Raffael Meyer
6096e45b36
test: switch tests to supported methods (#20494)
* fix: switch tests to supported methods

get_fetch_fields, update_linked_doctypes

* test: semantic assertions

* test: fixup deprecation tests imports

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-29 10:31:01 +05:30
Ankush Menat
07529ff1c3
fix: Consider parenttype when renaming (#19901) 2023-02-02 17:05:44 +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
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +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
Ankush Menat
359c7768f5 fix: multiple postgres transaction abort issues
- wrap setup fixtures in savepoint
- wrap scheduled_job_type in savepoint
- ignore duplicates where it's ignored by exc
- dont attempt to delete from deleted table
- delete custom field and commit - stale meta causes future inserts to
  insert unknown field.
2022-06-05 00:26:15 +05:30
Gavin D'souza
66655eb8ed Merge branch 'develop' of github.com:frappe/frappe into bg-rename_doc 2022-04-14 13:41:56 +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
Gavin D'souza
1ff0bbf6c6 test(fix): Add cleanup for test_doc_rename_method 2022-03-01 12:19:50 +05:30
Gavin D'souza
cd824f1c08 test(fix): Add property setter for ToDo to be made rename-able 2022-02-28 19:00:41 +05:30
Gavin D'souza
6c5a975cec test: Added test_doc_rename 2022-02-28 18:02:38 +05:30
Gavin D'souza
da260ab778 test: Use 'Module Def' to test update_document_title 2022-02-23 18:23:24 +05:30
Gavin D'souza
8aedf6410a fix: None is not NoneType
* also, rename test ;)
2022-02-18 20:19:51 +05:30
Gavin D'souza
ec1817de66 test: Add tests for rename_doc module 2022-02-18 20:17:18 +05:30
Gavin D'souza
2b4299a105 test: Set frappe.conf.developer_mode for test_rename_doc 2020-12-17 11:18:13 +05:30
Gavin D'souza
9d75094ba9 chore: Move reset flags to setup method
Reason for unsetting flags in setUp:
1. frappe.flags.whatever is reset in each request...since it's a werzeug local (ref: https://werkzeug.palletsprojects.com/en/1.0.x/local/)
2. so until it is in the context of current request, it has the same value
3. when you call rename_doc via a request, it's flags are forgotten post that
4. but in a test suite, the whole module's tests run in a single process and the flags aren't (un|re)set
5. which is why frappe.flags.whatever has the same value throughout this module's tests
2020-12-15 21:54:55 +05:30
marination
2d8550619d fix: Reset frappe.flag.link_fields in test
- Reset frappe.flag.link_fields in rename doctype tests
- Teardown doctypes appropriately after test
2020-12-15 16:04:16 +05:30
Gavin D'souza
147a3def0d fix: Use get_value to find value of linked_to_doctype instead
Tests ran successfully when run locally for mariaDB and postgres
2020-11-27 18:36:23 +05:30
Gavin D'souza
8a6bdf5466 chore: Move rename doctype method to dedicated TestCase
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2020-11-27 16:49:49 +05:30
Gavin D'souza
6357bb6392 test: Drop table if exists 2020-11-12 11:51:42 +05:30
Gavin D'souza
71225783e6 test: Rename doc tests 2020-11-11 20:05:31 +05:30