... d bypass an upstream access control based on URL paths. バグ修正 ¶ Fixed a regression in Django 3.2 that caused a crash of setUpTestData() with BinaryField on PostgreSQL, which is memoryview -backed ( #33333 ). 目次 Django 3.2.10 リリースノート CVE-2021-44420 ... リースノート fixes security issue severity Potential requests URLs trailing newlines バグ 修正 Fixed regression caused crash setUpTestData BinaryField PostgreSQL クイック検索 Last update: 2026年10月09日 « previous | up | next » ... ... 対するディスクアクセスを避けるための便利な手段です。すべてのデータはメモリ内にとどまり、テスト実行の後に破棄されます。 Using setUpTestData to create test data ¶ Moving common test data to TestCase.setUpTestData() will reduce the number of times your tests need ... to create the data. Using TestCase.setUpTestData() will create test data once per class. While TestCase.setUp() will create the test data once per test. 目次 テストを書いて ... トの並列実行 パスワードのハッシュ生成 テストデータベースを保存する メディアファイルに対するディスクアクセスを回避する Using setUpTestData to create test data 前のトピックへ Django におけるテスト 次のトピックへ テストツール 関連キーワード データベース test py T ... ... 対するディスクアクセスを避けるための便利な手段です。すべてのデータはメモリ内にとどまり、テスト実行の後に破棄されます。 Using setUpTestData to create test data ¶ Moving common test data to TestCase.setUpTestData() will reduce the number of times your tests need ... to create the data. Using TestCase.setUpTestData() will create test data once per class. While TestCase.setUp() will create the test data once per test. 目次 テストを書いて ... トの並列実行 パスワードのハッシュ生成 テストデータベースを保存する メディアファイルに対するディスクアクセスを回避する Using setUpTestData to create test data 前のトピックへ Django におけるテスト 次のトピックへ テストツール 関連キーワード データベース TestCase ... ... d bypass an upstream access control based on URL paths. バグ修正 ¶ Fixed a regression in Django 3.2 that caused a crash of setUpTestData() with BinaryField on PostgreSQL, which is memoryview -backed ( #33333 ). 目次 Django 3.2.10 リリースノート CVE-2021-44420 ... ... d when using the db_column name of a ForeignKey field with primary_key=True ( #12768 ). Prevented an exception in TestCase.setUpTestData() from leaking the transaction ( #25176 ). Fixed has_changed() method in contrib.postgres.forms.HStoreField ( #25215 , #25 ... ... d when using the db_column name of a ForeignKey field with primary_key=True ( #12768 ). Prevented an exception in TestCase.setUpTestData() from leaking the transaction ( #25176 ). Fixed has_changed() method in contrib.postgres.forms.HStoreField ( #25215 , #25 ... ... 最後に、deferrable なデータベース制約をチェックします。 さらに、以下のような追加メソッドを提供します。 classmethod TestCase. setUpTestData () [ソース] ¶ 上述のクラスレベルの atomic ブロックは、全体の TestCase に対して一度、クラスレベルでの初期データの作成を可能 ... を使うのに比べて高速なテストとなります。 例: from django.test import TestCase class MyTests ( TestCase ): @classmethod def setUpTestData ( cls ): # Set up data for the whole TestCase cls . foo = Foo . objects . create ( bar = "Test" ) ... def test1 ( self ): ... ... テストがトランザクションサポートのないデータベース (たとえば MyISAM エンジンの MySQL) で実行される場合、各テストの前に setUpTestData() が呼ばれ、高速化のメリットはなくなります。 Objects assigned to class attributes in setUpTestData() must support creating ... ... 最後に、deferrable なデータベース制約をチェックします。 さらに、以下のような追加メソッドを提供します。 classmethod TestCase. setUpTestData () [ソース] ¶ 上述のクラスレベルの atomic ブロックは、全体の TestCase に対して一度、クラスレベルでの初期データの作成を可能 ... を使うのに比べて高速なテストとなります。 例: from django.test import TestCase class MyTests ( TestCase ): @classmethod def setUpTestData ( cls ): # Set up data for the whole TestCase cls . foo = Foo . objects . create ( bar = "Test" ) ... def test1 ( self ): ... ... テストがトランザクションサポートのないデータベース (たとえば MyISAM エンジンの MySQL) で実行される場合、各テストの前に setUpTestData() が呼ばれ、高速化のメリットはなくなります。 Objects assigned to class attributes in setUpTestData() must support creating ... ... ched template loaders are now correctly reloaded in development. テスト ¶ Objects assigned to class attributes in TestCase.setUpTestData() are now isolated for each test method. Such objects are now required to support creating deep copies with copy.deepcopy( ... ¶ その他 ¶ Assigning objects which don't support creating deep copies with copy.deepcopy() to class attributes in TestCase.setUpTestData() is deprecated. Using a boolean value in BaseCommand.requires_system_checks is deprecated. Use '__all__' instead of True ... ... ched template loaders are now correctly reloaded in development. テスト ¶ Objects assigned to class attributes in TestCase.setUpTestData() are now isolated for each test method. Such objects are now required to support creating deep copies with copy.deepcopy( ... ¶ その他 ¶ Assigning objects which don't support creating deep copies with copy.deepcopy() to class attributes in TestCase.setUpTestData() is deprecated. Using a boolean value in BaseCommand.requires_system_checks is deprecated. Use '__all__' instead of True ... 2026年10月08日