... redirects to the test client and to SimpleTestCase.assertRedirects() because Django 1.9 no longer converts redirects to absolute URIs ( #26428 ). Fixed TimeField microseconds round-tripping ... gression バグ 修正 redirects MySQL SQLite values template リリースノート Added support relative path client SimpleTestCase assertRedirects because longer converts absolute URIs TimeField microseconds round クイック検索 Last update: 2026年10月09日 « previous | u ... ... redirects to the test client and to SimpleTestCase.assertRedirects() because Django 1.9 no longer converts redirects to absolute URIs ( #26428 ). Fixed TimeField microseconds round-tripping ... グ 修正 redirects MySQL SQLite values template リリースノート いくつ Added support relative path test client SimpleTestCase assertRedirects 関連するページ Django 3.1.4 リリースノート Django 1.11.8 リリースノート Django 5.1.7 リリースノート Django 4.0.5 リリースノ ... ... ce or absence of HTML fragments assertTemplateUsed() Template usage in a response assertURLEqual() That two URLs are equal assertRedirects() That an HTTP redirect occurred assertHTMLEqual() HTML fragment equality assertInHTML() HTML fragment containment assertX ... se ): def test_login ( self ): # First check for the default behavior response = self . client . get ( "/sekrit/" ) self . assertRedirects ( response , "/accounts/login/?next=/sekrit/" ) # Then override the LOGIN_URL setting with self . settings ( LOGIN_URL = " ... /other/login/" ): response = self . client . get ( "/sekrit/" ) self . assertRedirects ( response , "/other/login/?next=/sekrit/" ) この例では、 with ブロック内のコードに対して、 LOGIN_URL 設定をオーバーライド ... ... ce or absence of HTML fragments assertTemplateUsed() Template usage in a response assertURLEqual() That two URLs are equal assertRedirects() That an HTTP redirect occurred assertHTMLEqual() HTML fragment equality assertInHTML() HTML fragment containment assertX ... se ): def test_login ( self ): # First check for the default behavior response = self . client . get ( "/sekrit/" ) self . assertRedirects ( response , "/accounts/login/?next=/sekrit/" ) # Then override the LOGIN_URL setting with self . settings ( LOGIN_URL = " ... /other/login/" ): response = self . client . get ( "/sekrit/" ) self . assertRedirects ( response , "/other/login/?next=/sekrit/" ) この例では、 with ブロック内のコードに対して、 LOGIN_URL 設定をオーバーライド ... ... unner , which facilitate overriding the way tests are collected and run. The fetch_redirect_response argument was added to assertRedirects() . Since the test client can't fetch externals URLs, this allows you to use assertRedirects with redirects that aren't pa ... rt of your Django app. Correct handling of scheme when making comparisons in assertRedirects() . The secure argument was added to all the request methods of Client . If True , the request will be made through HTTPS. ... ... ecognizing the actual practice of user agents, almost all of which support them. Consequently, the expected URLs passed to assertRedirects should generally no longer include the scheme and domain part of the URLs. For example, self.assertRedirects(response, 'ht ... tp://testserver/some-url/') should be replaced by self.assertRedirects(response, '/some-url/') (unless the redirection specifically contained an absolute URL). In the rare case that you need th ... ... unner , which facilitate overriding the way tests are collected and run. The fetch_redirect_response argument was added to assertRedirects() . Since the test client can't fetch externals URLs, this allows you to use assertRedirects with redirects that aren't pa ... rt of your Django app. Correct handling of scheme when making comparisons in assertRedirects() . The secure argument was added to all the request methods of Client . If True , the request will be made through HTTPS. ... ... ecognizing the actual practice of user agents, almost all of which support them. Consequently, the expected URLs passed to assertRedirects should generally no longer include the scheme and domain part of the URLs. For example, self.assertRedirects(response, 'ht ... tp://testserver/some-url/') should be replaced by self.assertRedirects(response, '/some-url/') (unless the redirection specifically contained an absolute URL). In the rare case that you need th ... ... スト ¶ The new SimpleTestCase.assertURLEqual() assertion checks for a given URL, ignoring the ordering of the query string. assertRedirects() uses the new assertion. The test Client now supports automatic JSON serialization of list and tuple data when content_ty ... ... スト ¶ The new SimpleTestCase.assertURLEqual() assertion checks for a given URL, ignoring the ordering of the query string. assertRedirects() uses the new assertion. The test Client now supports automatic JSON serialization of list and tuple data when content_ty ... 2026年10月08日