seitime-frappe/frappe/tests
2024-10-07 17:54:12 +00:00
..
data test: Add test for lazy_import 2022-08-11 23:53:21 +05:30
__init__.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
README.md docs: add README for Frappe test utilities (#28016) 2024-10-07 17:54:12 +00:00
test_api.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_api_v2.py feat(APIv2): Add comment via REST API (#25889) 2024-04-10 10:53:22 +00:00
test_assign.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_auth.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_background_jobs.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_base_document.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_boilerplate.py test: adjust param for get_user_input_stream 2024-01-29 15:18:08 +01:00
test_boot.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_caching.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_child_table.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_client.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_commands.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_config.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_cors.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_dashboard_connections.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_db.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_db_query.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_db_update.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_defaults.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_deferred_insert.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_docstatus.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_document.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_document_locks.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_document_ro_mode.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_domainification.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_dynamic_links.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_email.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_exporter_fixtures.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_fixture_import.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_fmt_datetime.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_fmt_money.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_form_load.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_formatter.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_frappe_client.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_geo_ip.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_global_search.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_goal.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_hooks.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_linked_with.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_listview.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_model_utils.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_modules.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_monitor.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_naming.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_nestedset.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_non_nullable_docfield.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_oauth20.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_password.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_password_strength.py test: retry flaky password_strength test thrice 2023-12-20 13:57:48 +05:30
test_patches.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_pdf.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_perf.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_permissions.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_printview.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_query.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_query_builder.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_query_report.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_rate_limiter.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_rating.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_recorder.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_redis.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_rename_doc.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_reportview.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_safe_exec.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_scheduler.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_search.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_seen.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_sequence.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_sitemap.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_test_utils.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_trace.py feat: add value tracer for test debugging 2024-09-05 21:58:19 +02:00
test_translate.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_twofactor.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_utils.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_virtual_doctype.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_webform.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
test_website.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
tests_geo_utils.py refactor: unit vs integration treewide (#27992) 2024-10-06 09:43:36 +00:00
translation_test_file.txt feat: allow splitting _() function call on multiple lines 2022-03-26 16:18:35 +05:30
ui_test_helpers.py fix(test): fix tests 2024-08-14 17:08:01 +05:30
utils.py Testing Module (#28000) 2024-10-07 09:46:49 +02:00

Frappe Test Utilities

This README provides an overview of the test utilities available in the Frappe framework, particularly focusing on the frappe/tests/utils.py file. These utilities are designed to facilitate efficient and effective testing of Frappe applications.

Main Functions

The utils.py file contains several key components:

  1. Test record generation utilities
  2. Test case classes (UnitTestCase and IntegrationTestCase)
  3. Context managers for various testing scenarios
  4. Utility functions and decorators

Test Case Classes

UnitTestCase

This class extends unittest.TestCase and provides additional utilities specific to Frappe framework. It's designed for testing individual components or functions in isolation.

Some key methods and features include:

  • Custom assertions (e.g., assertQueryEqual, assertDocumentEqual)
  • HTML and SQL normalization
  • Context managers for user switching and time freezing

IntegrationTestCase

This class extends UnitTestCase and is designed for integration testing. It provides features for:

  • Automatic database setup and teardown
  • Database connection management
  • Query counting and Redis call monitoring
  • Lazy loading of test record dependencies

For a complete list of methods and their usage, please refer to the actual code in frappe/tests/utils.py.

Usage

To use these test utilities in your Frappe application tests, you can inherit from the appropriate test case class:

from frappe.tests.utils import UnitTestCase

class MyTestCase(UnitTestCase):
    def test_something(self):
        # Your test code here
        pass

Remember that this README provides an overview as of the time of writing. Always refer to the actual code for the most up-to-date and detailed information on available methods and their usage.

Contributing

If you're adding new test utilities or modifying existing ones, please ensure to update this README accordingly.