per page, with , order by , clip by
Results of 1 - 10 of about 33 for TestCase (0.009 sec.)
テストツール 15626
テストツール Django は、テストを書くのに便利なツールをいくつか提供しています。 There are community-maintained solutions! Django has a vibrant ecosystem. There are testing and fixtures solutions highlighted on the Community Ecosystem page. T ... トするために使います。また、Django はこれらのフレームワーク向けの特別なサポートも提供しています。詳細については、 LiveServerTestCase のセクションを読んでください。 包括的なテストスイートを実現するには、これらすべてのタイプのテストを組み合わせて行うべきです ... テストクライアントを使ったユニットテストです。 import unittest from django.test import Client class SimpleTest ( unittest . TestCase ): def setUp ( self ): # Every test needs a client. self . client = Client () def test_details ( self ): # Issue a GET req ... " ]), 5 ) 参考 django.test.RequestFactory 提供されるテストケースのクラス 標準の Python ユニットテストのクラスは、 unittest.TestCase のベースクラスを拡張しています。Django は、このベースクラスのいくつかの拡張を提供します。 Django ユニットテストクラスの階層 ...
https://man.mtool.work/django/6.1/topics/testing/tools.html
テストを書いて実行する 11663
テストを書いて実行する 参考 テストチュートリアル 、 テストツールリファレンス 、 テストに関する応用的なトピック も参照 ドキュメントは2つの大きなセクションに分けられます。前半のパートでは、Django でのテストの書き方を説明します。後半では、テス ... のモジュール、 unittest を使用します。このモジュールは、テストをクラスベースのアプローチで定義します。 次の例では、 unittest.TestCase のサブクラスである django.test.TestCase から、テスト用の新しいサブクラスを作っています。各テストをトランザクションの内側で ... 実行することで、独立性を実現しています。 from django.test import TestCase from myapp.models import Animal class AnimalTestCase ( TestCase ): def setUp ( self ): Animal . objects . create ( name = ... トユーティリティのデフォルトの動作として、ファイル名が test で始まるファイル内のすべてのテストケースクラス (つまり unittest.TestCase のサブクラス) を見つけ、それらのテストケースクラスから自動的にテストスイートを構築し、そのテストスイートを実行します。 uni ...
https://man.mtool.work/django/6.1/topics/testing/overview.html
テストに関する高度なトピック 9930
テストに関する高度なトピック RequestFactory(リクエスト ファクトリ) class RequestFactory [ソース] RequestFactory はテストクライアントと同じ API を共有しています。しかし、ブラウザのように動作するのではなく、 RequestFactory は任意のビューの最 ... ったユニットテストです: from django.contrib.auth.models import AnonymousUser , User from django.test import RequestFactory , TestCase from .views import MyView , my_view class SimpleTest ( TestCase ): def setUp ( self ): # Every test needs access to the re ... トするには、まずビューをインスタンス化して setup() に request を渡します: tests.py from django.test import RequestFactory , TestCase from .views import HomeView class HomePageTest ( TestCase ): def test_environment_set_in_context ( self ): request = Reque ... ファイルに追加することです。例えば、docs.djangoproject.com のテストスイートには以下が含まれています: from django.test import TestCase class SearchFormTestCase ( TestCase ): def test_empty_get ( self ): response = self . client . get ( "/en/dev/search/" , h ...
https://man.mtool.work/django/6.1/topics/testing/advanced.html
はじめての Django アプリ作成、その 5 8663
はじめての Django アプリ作成、その 5 このチュートリアルは チュートリアル 4 の続きです。Web 投票アプリケーションが完成したので、今度は自動テストを作ってみましょう。 困ったときは: このチュートリアルの実行に問題がある場合は、FAQ の Getting Hel ... polls アプリケーションの tests.py ファイルに次のコードを書きます。 polls/tests.py import datetime from django.test import TestCase from django.utils import timezone from .models import Question class QuestionModelTests ( TestCase ): def test_was_publish ... ed_recently (), False ) ここでは、未来の日付の pub_date を持つ Question のインスタンスを生成するメソッドを持つ django.test.TestCase を継承したサブクラスを作っています。それから、 was_published_recently() の出力をチェックしています。これは False になるはず ... こでは以下のようなことが起こりました。 manage.py test polls は、 polls アプリケーション内にあるテストを探します django.test.TestCase クラスのサブクラスを発見します テストのための特別なデータベースを作成します テスト用のメソッドとして、 test で始まるメソッ ...
https://man.mtool.work/django/6.1/intro/tutorial05.html
Django 1.8 リリースノート 8262
Django 1.8 リリースノート April 1, 2015 Django 1.8 へようこそ! このリリースノートでは、 バージョン 1.8 の新機能 と、Django 1.7 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... n queries. A collection of database functions is also included with functionality such as Coalesce , Concat , and Substr . TestCase data setup TestCase has been refactored to allow for data initialization at the class level using transactions and savepoi ... ents. Tests are now run within two nested atomic() blocks: one for the whole class and one for each test. The class method TestCase.setUpTestData() adds the ability to set up test data at the class level. Using this technique can speed up the tests as co ... mpared to using setUp() . Fixture loading within TestCase is now performed once for the whole TestCase . マイナーな機能 django.contrib.admin ModelAdmin now has a has_module_permiss ...
https://man.mtool.work/django/6.1/releases/1.8.html
データベースのトランザクション 8262
データベースのトランザクション Django では、データベースのトランザクションをコントロールする方法が提供されています。 データベースのトランザクションを管理する Django のデフォルトのトランザクションの動作 Django のデフォルトの動作は、オートコミ ... ブポイントを使い、特に delete() と update() クエリにおいて、複数のクエリを要求する ORM 操作の信頼性を担保します。 Django の TestCase クラスは、パフォーマンス向上のため、各テストをトランザクションでラップします。 HTTP リクエストにトランザクションを結びつけ ... エラーはすべて捕捉され、 django.db.backends.base ロガーに記録されます。 on_commit() で登録されたコールバックをテストするには TestCase.captureOnCommitCallbacks() を使用します。 セーブポイント セーブポイント(ネストされた atomic() ブロック)は正しく処理されま ... 。オートコミットが無効でアトミックブロック内にいない時に on_commit() を呼び出すとエラーになります。 テストでの使用 Django の TestCase クラスは各テストをトランザクションでラップし、テストの分離を行うために、各テストの後にそのトランザクションをロールバックし ...
https://man.mtool.work/django/6.1/topics/db/transactions.html
Django 1.8.4 リリースノート 8021
Django 1.8.4 リリースノート August 18, 2015 Django 1.8.4 fixes a security issue and several bugs in 1.8.3. Denial-of-service possibility in logout() view by filling session store Previously, a session could be created when anonymously acces ... not raised 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 ...
https://man.mtool.work/django/6.1/releases/1.8.4.html
Django 2.2 リリースノート 8021
Django 2.2 リリースノート April 1, 2019 Django 2.2 へようこそ! このリリースノートでは、 バージョン 2.2 の新機能 と、Django 2.1 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... =True to serializers.deserialize() . Additionally, loaddata handles forward references automatically. テスト The new SimpleTestCase.assertURLEqual() assertion checks for a given URL, ignoring the ordering of the query string. assertRedirects() uses the n ... ng allows using Oracle Managed Files (OMF) tablespaces. Deferrable database constraints are now checked at the end of each TestCase test on SQLite 3.20+, just like on other backends that support deferrable constraints. These checks aren't implemented for ... seAdmin ): actions = BaseAdmin . actions + [ "b" ] django.contrib.gis Support for GDAL 1.9 and 1.10 is dropped. TransactionTestCase serialized data loading Initial data migrations are now loaded in TransactionTestCase at the end of the test, after the da ...
https://man.mtool.work/django/6.1/releases/2.2.html
Django 3.2 リリースノート 7877
Django 3.2 リリースノート April 6, 2021 Django 3.2 へようこそ! このリリースノートでは、 バージョン 3.2 の新機能 と、Django 3.1 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... hed with Cached 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 ... sing the test --timing option. Client now preserves the request query string when following 307 and 308 redirects. The new TestCase.captureOnCommitCallbacks() method captures callback functions passed to transaction.on_commit() in a list. This allows you ... to test such callbacks without using the slower TransactionTestCase . TransactionTestCase.assertQuerysetEqual() now supports direct comparison against another queryset rather than being rest ...
https://man.mtool.work/django/6.1/releases/3.2.html
Django 4.0.2 リリースノート 7877
Django 4.0.2 リリースノート 2022年2月1日 Django 4.0.2 では、 4.0.1 における深刻度 "medium" のセキュリティの問題2件と、いくつかのバグを修正しました。また、 Transifex からの最新の文字列翻訳が反映され、ブルガリア語の翻訳が完了しました。 CVE-20 ... in inputs to multipart forms could result in an infinite loop when parsing files. バグ修正 Fixed a bug in Django 4.0 where TestCase.captureOnCommitCallbacks() could execute callbacks multiple times ( #33410 ). Fixed a regression in Django 4.0 where help_ ...
https://man.mtool.work/django/6.1/releases/4.0.2.html
PREV 1 2 3 4 NEXT