Django Unit Test Generator
Generates full CRUD unit tests for a Django Viewset, including edge cases.
ChatGPTCode & Tech
89 words · free to use
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 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. Organize the generated test cases with descriptive method names and comments for clarity.
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT and send it. It also works in other AI chat tools.
- Not quite right? Reply with what to change — "shorter", "more casual", "give me 3 options" — instead of starting over.