メインコンテンツへスキップ
PromptDaily毎日キュレーション・検証されるAIプロンプト
日常

Viewsets 用の Django ユニットテストジェネレーター

Django Unit Test Generator for Viewsets

テスト済みモデル:
GPT-4o
有効性スコア:
80/100
プロンプトアーカイブ

日本語バージョン

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.

値を入れて実行

新しいタブが開き、プロンプトが入力済みの状態になります。ログインが必要な場合があります。

このプロンプトの使い方

  • 角かっこで囲まれた部分を自分の内容に置き換えてから送信してください。
  • モデルによって結果は変わります。期待した出力でなければ、別のモデルを試すか、具体例を1つ追加してください。
  • プロンプトは1つのメッセージにまとめて送ってください。分割すると指示が弱まります。

日常のプロンプト