[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73B2HSP02EMB5JTXE5BT9YA":3,"skill-same:01M73B2HSP02EMB5JTXE5BT9YA":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M73B2HSP02EMB5JTXE5BT9YA","odoo-automated-tests",null,"Write and run Odoo automated tests using TransactionCase, HttpCase, and browser tour tests. Covers test data setup, mocking, and CI integration.","kalash33\u002Fkstack","kalash33","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F90259149?v=4","01M7365X8Q0B73NYHA730SMZWN","Kalash Poddar","01M7365X9D0JK47C3Q0YCCK9Z2",0,"MIT","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fodoo-automated-tests\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: odoo-automated-tests\ndescription: \"Write and run Odoo automated tests using TransactionCase, HttpCase, and browser tour tests. Covers test data setup, mocking, and CI integration.\"\nrisk: safe\nsource: \"self\"\n---\n\n# Odoo Automated Tests\n\n## Overview\n\nOdoo has a built-in testing framework based on Python's `unittest`. This skill helps you write `TransactionCase` unit tests, `HttpCase` integration tests, and JavaScript tour tests. It also covers running tests in CI pipelines.\n\n## When to Use This Skill\n\n- Writing unit tests for a custom model's business logic.\n- Creating an HTTP test to verify a controller endpoint.\n- Debugging test failures in a CI pipeline.\n- Setting up automated test execution with `--test-enable`.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-automated-tests` and describe the feature to test.\n2. **Generate**: Get complete test class code with setup, teardown, and assertions.\n3. **Run**: Get the exact `odoo` CLI command to execute your tests.\n\n## Examples\n\n### Example 1: TransactionCase Unit Test (Odoo 15+ pattern)\n\n```python\n# tests\u002Ftest_hospital_patient.py\nfrom odoo.tests.common import TransactionCase\nfrom odoo.tests import tagged\nfrom odoo.exceptions import ValidationError\n\n@tagged('post_install', '-at_install')\nclass TestHospitalPatient(TransactionCase):\n\n    @classmethod\n    def setUpClass(cls):\n        # Use setUpClass for performance — runs once per class, not per test\n        super().setUpClass()\n        cls.Patient = cls.env['hospital.patient']\n        cls.doctor = cls.env['res.users'].browse(cls.env.uid)\n\n    def test_create_patient(self):\n        patient = self.Patient.create({\n            'name': 'John Doe',\n            'doctor_id': self.doctor.id,\n        })\n        self.assertEqual(patient.state, 'draft')\n        self.assertEqual(patient.name, 'John Doe')\n\n    def test_confirm_patient(self):\n        patient = self.Patient.create({'name': 'Jane Smith'})\n        patient.action_confirm()\n        self.assertEqual(patient.state, 'confirmed')\n\n    def test_empty_name_raises_error(self):\n        with self.assertRaises(ValidationError):\n            self.Patient.create({'name': ''})\n\n    def test_access_denied_for_other_user(self):\n        # Test security rules by running as a different user\n        other_user = self.env.ref('base.user_demo')\n        with self.assertRaises(Exception):\n            self.Patient.with_user(other_user).create({'name': 'Test'})\n```\n\n> **`setUpClass` vs `setUp`:** Use `setUpClass` (Odoo 15+) for shared test data. It runs once per class and is significantly faster than `setUp` which re-initializes for every single test method.\n\n### Example 2: Run Tests via CLI\n\n```bash\n# Run all tests for a specific module\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database -u hospital_management\n\n# Run only tests tagged with a specific tag\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database \\\n  --test-tags hospital_management\n\n# Run a specific test class\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database \\\n  --test-tags \u002Fhospital_management:TestHospitalPatient\n```\n\n### Example 3: HttpCase for Controller Testing\n\n```python\nfrom odoo.tests.common import HttpCase\nfrom odoo.tests import tagged\n\n@tagged('post_install', '-at_install')\nclass TestPatientController(HttpCase):\n\n    def test_patient_page_authenticated(self):\n        # Authenticate as a user, not with hardcoded password\n        self.authenticate(self.env.user.login, self.env.user.login)\n        resp = self.url_open('\u002Fhospital\u002Fpatients')\n        self.assertEqual(resp.status_code, 200)\n\n    def test_patient_page_redirects_unauthenticated(self):\n        # No authenticate() call = public\u002Fanonymous user\n        resp = self.url_open('\u002Fhospital\u002Fpatients', allow_redirects=False)\n        self.assertIn(resp.status_code, [301, 302, 403])\n```\n\n## Best Practices\n\n- ✅ **Do:** Use `setUpClass()` with `cls.env` instead of `setUp()` — it is dramatically faster for large test suites.\n- ✅ **Do:** Use `@tagged('post_install', '-at_install')` to run tests after all modules are installed.\n- ✅ **Do:** Test both the happy path and error conditions (`ValidationError`, `AccessError`, `UserError`).\n- ✅ **Do:** Use `self.with_user(user)` to test access control without calling `sudo()`.\n- ❌ **Don't:** Use a production database for tests — always use a dedicated test database.\n- ❌ **Don't:** Rely on test execution order — each `TransactionCase` test is rolled back in isolation.\n- ❌ **Don't:** Hardcode passwords in `HttpCase.authenticate()` — use `self.env.user.login` or a fixture user.\n\n## Limitations\n\n- **JavaScript tour tests** require a running browser (via `phantomjs` or `Chrome headless`) and a live Odoo server — not covered in depth here.\n- `HttpCase` tests are significantly slower than `TransactionCase` — use them only for controller\u002Froute verification.\n- Does not cover **mocking external services** (e.g., mocking an SMTP server or payment gateway in tests).\n- Test isolation is at the **transaction level**, not database level — tests that commit data (e.g., via `cr.commit()`) can leak state between tests.\n","# Odoo Automated Tests\n\n## Overview\n\nOdoo has a built-in testing framework based on Python's `unittest`. This skill helps you write `TransactionCase` unit tests, `HttpCase` integration tests, and JavaScript tour tests. It also covers running tests in CI pipelines.\n\n## When to Use This Skill\n\n- Writing unit tests for a custom model's business logic.\n- Creating an HTTP test to verify a controller endpoint.\n- Debugging test failures in a CI pipeline.\n- Setting up automated test execution with `--test-enable`.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-automated-tests` and describe the feature to test.\n2. **Generate**: Get complete test class code with setup, teardown, and assertions.\n3. **Run**: Get the exact `odoo` CLI command to execute your tests.\n\n## Examples\n\n### Example 1: TransactionCase Unit Test (Odoo 15+ pattern)\n\n```python\n# tests\u002Ftest_hospital_patient.py\nfrom odoo.tests.common import TransactionCase\nfrom odoo.tests import tagged\nfrom odoo.exceptions import ValidationError\n\n@tagged('post_install', '-at_install')\nclass TestHospitalPatient(TransactionCase):\n\n    @classmethod\n    def setUpClass(cls):\n        # Use setUpClass for performance — runs once per class, not per test\n        super().setUpClass()\n        cls.Patient = cls.env['hospital.patient']\n        cls.doctor = cls.env['res.users'].browse(cls.env.uid)\n\n    def test_create_patient(self):\n        patient = self.Patient.create({\n            'name': 'John Doe',\n            'doctor_id': self.doctor.id,\n        })\n        self.assertEqual(patient.state, 'draft')\n        self.assertEqual(patient.name, 'John Doe')\n\n    def test_confirm_patient(self):\n        patient = self.Patient.create({'name': 'Jane Smith'})\n        patient.action_confirm()\n        self.assertEqual(patient.state, 'confirmed')\n\n    def test_empty_name_raises_error(self):\n        with self.assertRaises(ValidationError):\n            self.Patient.create({'name': ''})\n\n    def test_access_denied_for_other_user(self):\n        # Test security rules by running as a different user\n        other_user = self.env.ref('base.user_demo')\n        with self.assertRaises(Exception):\n            self.Patient.with_user(other_user).create({'name': 'Test'})\n```\n\n> **`setUpClass` vs `setUp`:** Use `setUpClass` (Odoo 15+) for shared test data. It runs once per class and is significantly faster than `setUp` which re-initializes for every single test method.\n\n### Example 2: Run Tests via CLI\n\n```bash\n# Run all tests for a specific module\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database -u hospital_management\n\n# Run only tests tagged with a specific tag\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database \\\n  --test-tags hospital_management\n\n# Run a specific test class\n.\u002Fodoo-bin --test-enable --stop-after-init -d my_database \\\n  --test-tags \u002Fhospital_management:TestHospitalPatient\n```\n\n### Example 3: HttpCase for Controller Testing\n\n```python\nfrom odoo.tests.common import HttpCase\nfrom odoo.tests import tagged\n\n@tagged('post_install', '-at_install')\nclass TestPatientController(HttpCase):\n\n    def test_patient_page_authenticated(self):\n        # Authenticate as a user, not with hardcoded password\n        self.authenticate(self.env.user.login, self.env.user.login)\n        resp = self.url_open('\u002Fhospital\u002Fpatients')\n        self.assertEqual(resp.status_code, 200)\n\n    def test_patient_page_redirects_unauthenticated(self):\n        # No authenticate() call = public\u002Fanonymous user\n        resp = self.url_open('\u002Fhospital\u002Fpatients', allow_redirects=False)\n        self.assertIn(resp.status_code, [301, 302, 403])\n```\n\n## Best Practices\n\n- ✅ **Do:** Use `setUpClass()` with `cls.env` instead of `setUp()` — it is dramatically faster for large test suites.\n- ✅ **Do:** Use `@tagged('post_install', '-at_install')` to run tests after all modules are installed.\n- ✅ **Do:** Test both the happy path and error conditions (`ValidationError`, `AccessError`, `UserError`).\n- ✅ **Do:** Use `self.with_user(user)` to test access control without calling `sudo()`.\n- ❌ **Don't:** Use a production database for tests — always use a dedicated test database.\n- ❌ **Don't:** Rely on test execution order — each `TransactionCase` test is rolled back in isolation.\n- ❌ **Don't:** Hardcode passwords in `HttpCase.authenticate()` — use `self.env.user.login` or a fixture user.\n\n## Limitations\n\n- **JavaScript tour tests** require a running browser (via `phantomjs` or `Chrome headless`) and a live Odoo server — not covered in depth here.\n- `HttpCase` tests are significantly slower than `TransactionCase` — use them only for controller\u002Froute verification.\n- Does not cover **mocking external services** (e.g., mocking an SMTP server or payment gateway in tests).\n- Test isolation is at the **transaction level**, not database level — tests that commit data (e.g., via `cr.commit()`) can leak state between tests.\n",{"name":5,"risk":24,"source":25,"description":7},"safe","self","main","b30820b3248f6676d5389f0ccabd4e5250c9c536","skills\u002Fodoo-automated-tests","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack","https:\u002F\u002Fgithub.com\u002Fkalash33","kalashpoddar.me","Tech-savvy Full Stack Developer 🚀 | Cybersecurity enthusiast 🔒 | Passionate about innovation and securing the digital world 🌐 | Let's code securely! 💻🔐","2026-05-20 04:11:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add kalash33\u002Fkstack --skill odoo-automated-tests",{"tool":40,"command":41},"bunx","bunx skills add kalash33\u002Fkstack --skill odoo-automated-tests",{"tool":43,"command":44},"pnpm","pnpm dlx skills add kalash33\u002Fkstack --skill odoo-automated-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fodoo-automated-tests\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M73CFERCR43JCAP606E41EFB","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reacti...","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M73CFCMFVTAQEMTZ5HR10X8V","zoom-automation","Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-automation\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M73CFAA7EBWXJVXDQ1X555MB","zoho-crm-automation","Automate Zoho CRM tasks via Rube MCP (Composio): create\u002Fupdate records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzoho-crm-automation\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M73CF80XCM9K81567MJ8QZFW","zod-validation-expert","Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzod-validation-expert\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M73CF4YPMF3RA8ZJDXZSMD93","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M73CF2S25EN3XNAMKY47XHPS","zendesk-automation","Automate Zendesk tasks via Rube MCP (Composio): tickets, users, organizations, replies. Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fkalash33\u002Fkstack\u002Fblob\u002Fmain\u002Fskills\u002Fzendesk-automation\u002FSKILL.md",[],[]]