per page, with , order by , clip by
Results of 1 - 5 of about 5 for assertIs (0.008 sec.)
はじめての Django アプリ作成、その 5 12832
はじめての Django アプリ作成、その 5 このチュートリアルは チュートリアル 4 の続きです。Web 投票アプリケーションが完成したので、今度は自動テストを作ってみましょう。 困ったときは: このチュートリアルの実行に問題がある場合は、FAQ の Getting Hel ... e. """ time = timezone . now () + datetime . timedelta ( days = 30 ) future_question = Question ( pub_date = time ) self . assertIs ( future_question . was_published_recently (), False ) ここでは、未来の日付の pub_date を持つ Question のインスタンスを生成 ... ast ) : File "/path/to/djangotutorial/polls/tests.py" , line 16 , in test_was_published_recently_with_future_question self.assertIs ( future_question.was_published_recently () , False ) AssertionError: True is not False ---------------------------------- ... uture_question の中で、 pub_date フィールドに今日から30日後の日付を持つ Question インスタンスが作成されます そして最後に、 assertIs() メソッドを使うことで、本当に返してほしいのは False だったにもかかわらず、 was_published_recently() が True を返しているこ ...
https://man.mtool.work/django/6.1/intro/tutorial05.html
Coding style 8401
Coding style Please follow these coding standards when writing code for inclusion in Django. Pre-commit checks pre-commit is a framework for managing pre-commit hooks. These hooks help to identify simple issues before committing code for re ... ption or warning message. Use assertRaisesRegex() and assertWarnsRegex() only if you need regular expression matching. Use assertIs(…, True/False) for testing boolean values, rather than assertTrue() and assertFalse() , so you can check the actual boolea ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/coding-sty...
メールを送信する 8401
メールを送信する Django provides wrappers for Python's email and smtplib modules to simplify composing and sending email. Django's email framework also supports swapping in different delivery mechanisms: you can direct email to the console ... subject , "I am content." , from_email , [ to ]) msg . attach_alternative ( "<p>I am content.</p>" , "text/html" ) self . assertIs ( msg . body_contains ( "I am content" ), True ) self . assertIs ( msg . body_contains ( "<p>I am content.</p>" ), False ) ...
https://man.mtool.work/django/6.1/topics/email.html
テストツール 8401
テストツール Django は、テストを書くのに便利なツールをいくつか提供しています。 There are community-maintained solutions! Django has a vibrant ecosystem. There are testing and fixtures solutions highlighted on the Community Ecosystem page. T ... iew ) # Class-based views need to compare the view_class, as the # functions generated by as_view() won't be equal. self . assertIs ( response . resolver_match . func . view_class , MyView ) 指定された URL が見つからない場合、この属性にアクセスすると Res ... estModelDefinition ( SimpleTestCase ): def test_model_definition ( self ): class TestModel ( models . Model ): pass self . assertIs ( self . apps . get_model ( "app_label" , "TestModel" ), TestModel ) あるいは、 kwarg_name パラメータを使ってメソッドデコレ ... _label" , kwarg_name = "apps" ) def test_model_definition ( self , apps ): class TestModel ( models . Model ): pass self . assertIs ( apps . get_model ( "app_label" , "TestModel" ), TestModel ) テスト用の送信トレイを空にする Django のカスタムの TestCase ...
https://man.mtool.work/django/6.1/topics/testing/tools.html
テストを書いて実行する 7850
テストを書いて実行する 参考 テストチュートリアル 、 テストツールリファレンス 、 テストに関する応用的なトピック も参照 ドキュメントは2つの大きなセクションに分けられます。前半のパートでは、Django でのテストの書き方を説明します。後半では、テス ... st recent call last ) : File "/dev/mysite/polls/tests.py" , line 16 , in test_was_published_recently_with_future_poll self.assertIs ( future_poll.was_published_recently () , False ) AssertionError: True is not False -------------------------------------- ...
https://man.mtool.work/django/6.1/topics/testing/overview.html
PREV 1 NEXT