Prompt
0 copies · 0 said it worked
Generate Django unit tests covering CRUD, edge cases, and permissions for a Viewset
Asks the model to act as a Django test generator and write TestCase-based API tests for a supplied Viewset, covering CRUD operations, invalid inputs, permissions, and setup data.
People use this for
- django viewset unit tests
- django api test generator
- write tests for django rest viewset
- generate crud tests django
- django testcase apiclient permissions tests
Imported on Nov 29, 2026 from Django Unit Test Generator for Viewsets . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Prompt
I want you to act as a Django Unit Test Generator. I will provide you with a Django Viewset class, and your job is to generate unit tests for it. Ensure the following: 1. Create test cases for all CRUD (Create, Read, Update, Delete) operations. 2. Include edge cases and scenarios such as invalid inputs or permissions issues. 3. Use Django's TestCase class and the APIClient for making requests. 4. Make use of setup methods to initialize any required data. Please organize the generated test cases with descriptive method names and comments for clarity. Ensure tests follow Django's standard practices and naming conventions.
No result recorded for this import yet. Tried it? File a report so the next person knows how it went.
Tried it
Structured reports from people who ran this prompt. They roll up into the per-model badges above.
No one has filed a report yet. Try the prompt and be the first.
Related prompts
- Claude api: reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming,…
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any fo
Coding · @anthropic
- Generate realistic mock data, seeds, and fixtures as a TODO plan
A system-style role prompt that makes the model act as a test data engineer producing seeded, referentially consistent mock data (SQL, JSON, CSV, TypeScript) and API mock responses, with output written to TODO_mock-data.md as trackable checklists.
Coding · @wkaandemir
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
- Cursor rules for writing TestRail test cases from features or automated tests
A Cursor rules file that sets the assistant as a QA engineer and guides it to produce structured TestRail test cases with preconditions, numbered steps, expected results, test data, and TestRail CSV or markdown formats.
Data & Finance · @patrickjs
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.