From 3dd0a783172bada8b836c81059a658e038b50b89 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 6 Dec 2013 22:19:22 +0000 Subject: [PATCH] Version 2.3.10 --- api-guide/status-codes.html | 19 +++++++++++++++++++ topics/credits.html | 1 + topics/release-notes.html | 5 ++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/api-guide/status-codes.html b/api-guide/status-codes.html index 906b2f9e5..6c6a6ff9c 100644 --- a/api-guide/status-codes.html +++ b/api-guide/status-codes.html @@ -174,6 +174,7 @@
  • Redirection - 3xx
  • Client Error - 4xx
  • Server Error - 5xx
  • +
  • Helper functions

  • @@ -220,6 +221,16 @@ def empty_view(self): return Response(content, status=status.HTTP_404_NOT_FOUND)

    The full set of HTTP status codes included in the status module is listed below.

    +

    The module also includes a set of helper functions for testing if a status code is in a given range.

    +
    from rest_framework import status
    +from rest_framework.test import APITestCase
    +
    +class ExampleTestCase(APITestCase):
    +    def test_url_root(self):
    +        url = reverse('index')
    +        response = self.client.get(url)
    +        self.assertTrue(status.is_success(response.status_code))
    +

    For more information on proper usage of HTTP status codes see RFC 2616 and RFC 6585.

    Informational - 1xx

    @@ -281,6 +292,14 @@ HTTP_503_SERVICE_UNAVAILABLE HTTP_504_GATEWAY_TIMEOUT HTTP_505_HTTP_VERSION_NOT_SUPPORTED HTTP_511_NETWORK_AUTHENTICATION_REQUIRED + +

    Helper functions

    +

    The following helper functions are available for identifying the category of the response code.

    +
    is_informational()  # 1xx
    +is_success()        # 2xx
    +is_redirect()       # 3xx
    +is_client_error()   # 4xx
    +is_server_error()   # 5xx
     
    diff --git a/topics/credits.html b/topics/credits.html index 1991f1e21..f22ce5026 100644 --- a/topics/credits.html +++ b/topics/credits.html @@ -383,6 +383,7 @@
  • Rob Hudson - robhudson
  • Alex Good - alexjg
  • Ian Foote - ian-foote
  • +
  • Chuck Harmston - chuckharmston
  • Many thanks to everyone who's contributed to the project.

    Additional thanks

    diff --git a/topics/release-notes.html b/topics/release-notes.html index 6c205ab25..74d4ba186 100644 --- a/topics/release-notes.html +++ b/topics/release-notes.html @@ -244,10 +244,13 @@

    2.3.x series

    -

    Master

    +

    2.3.10

    +

    Date: 6th December 2013