frappe-unit-test-generator

Generate Python unittest suites for Frappe DocTypes, controllers, and API methods.

25|14|Updated Dec 15, 2025
One-click install
npx skills add https://github.com/Venkateshvenki404224/frappe-apps-manager --skill frappe-unit-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-unit-test-generator
Source: https://github.com/Venkateshvenki404224/frappe-apps-manager/tree/main/frappe-apps-manager/skills/frappe-unit-test-generator
Command: npx skills add https://github.com/Venkateshvenki404224/frappe-apps-manager --skill frappe-unit-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing comprehensive unit tests for Frappe DocTypes, controllers, and API methods is essential for code quality but can be a time-consuming and repetitive task. This Skill automates unit test generation following best practices.

Core Features & Use Cases

  • DocType Test Structure: Generate complete Python test files with setUp and tearDown methods for consistent test environments.
  • Validation & Calculation Tests: Create test cases to verify controller validations, field calculations, and core business logic.
  • Permission & API Tests: Generate tests for role-based permissions and whitelisted API methods, ensuring secure and correct access.
  • Use Case: Generate unit tests for the 'Sales Invoice' DocType, covering posting date validation, total amount calculation, and the submission workflow.

Quick Start

Generate unit tests for the 'Item' DocType, including tests for its creation, validation of required fields, and ensuring stock UOM is set correctly.

Frequently Asked Questions about frappe-unit-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate unit tests for Frappe DocTypes automatically?

Generate unit tests for Frappe DocTypes by providing the DocType name and specifying test scope—validation, calculation, permissions, or workflows. The Skill produces Python unittest files with setUp, tearDown, and complete test case structures following ERPNext patterns, ready to run immediately.

Can I create tests for API methods and role-based permissions in Frappe?

Yes. Generate tests for whitelisted API methods and role-based permissions by specifying the method or permission rules. The Skill produces test cases that verify access control and correct API behavior across different user roles.

What test structure does this generate for Frappe controllers?

Test generation includes setUp and tearDown scaffolding, validation test cases, calculation verification, workflow state transitions, and fixture helpers for consistent test environments. Tests follow Frappe core patterns and are production-ready Python unittest suites.

Do I need to write test boilerplate manually for Frappe projects?

No. The Skill eliminates repetitive test scaffolding by generating complete Python test files with fixtures, helper methods, and example test structures for DocType creation, validations, calculations, and workflows—saving setup time and ensuring consistency.

How do I test business logic and validations in ERPNext DocTypes?

Specify the DocType and validation rules or business logic to test. The Skill generates focused test cases covering field validations, calculations, state transitions, and permission enforcement, with example structures you customize for your specific rules.

What's the best way to ensure code quality in Frappe applications?

Implement unit tests covering DocTypes, controllers, and API methods using test-driven development. Automated test generation reduces gaps and accelerates TDD workflows, ensuring validation logic, permissions, calculations, and workflows are verified before deployment.