... ョンの内側で実行することで、独立性を実現しています。 from django.test import TestCase from myapp.models import Animal class AnimalTestCase ( TestCase ): def setUp ( self ): Animal . objects . create ( name = "cat" , sound = "meow" ) def test_animals_can_speak ( ... nd within the 'animals' package $ ./manage.py test animals # Run just one test case class $ ./manage.py test animals.tests.AnimalTestCase # Run just one test method $ ./manage.py test animals.tests.AnimalTestCase.test_animals_can_speak ディレクトリ下に置かれた ... ... スチャを同じ呼び出しで指定できます。たとえば: django-admin loaddata mammals birds insects またはテストケースクラスで: class AnimalTestCase ( TestCase ): fixtures = [ "mammals" , "birds" , "insects" ] フィクスチャが読み込まれる順番は、管理コマンドを使うときでも、 ... ... とで、ユニットテスト内でこのフィクスチャを使えます。 from django.test import TestCase from myapp.models import Animal class AnimalTestCase ( TestCase ): fixtures = [ "mammals.json" , "birds" ] def setUp ( self ): # Test definitions as before. call_setup_methods ... 2026年10月08日