Django Unit Test Generator for Viewsets
Generates unit tests for a given Django Viewset, including CRUD operations and edge cases.
Content
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.
Related Prompts
Optimize Large Data Reading in Code
Provide guidance on optimizing the reading of large data sets in code to improve performance and efficiency.
Code Translator: Any Language to Any Language
This prompt allows you to translate code from one programming language to another, providing comments for clarity.
Code Review Assistant
Act as a code review assistant to evaluate and provide feedback on code quality, style, and functionality.
Continue Coding Assistant
Act as a coding assistant to help continue an existing codebase or project with clear instructions and coding practices.