summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/http/sessions.txt26
-rw-r--r--docs/topics/testing/tools.txt4
2 files changed, 15 insertions, 15 deletions
diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt
index 2cf4751212..5711b0c490 100644
--- a/docs/topics/http/sessions.txt
+++ b/docs/topics/http/sessions.txt
@@ -219,17 +219,17 @@ You can edit it multiple times.
Example: ``fav_color = request.session.pop('fav_color')``
- .. method:: keys
+ .. method:: keys()
- .. method:: items
+ .. method:: items()
- .. method:: setdefault
+ .. method:: setdefault()
- .. method:: clear
+ .. method:: clear()
It also has these methods:
- .. method:: flush
+ .. method:: flush()
Delete the current session data from the session and regenerate the
session key value that is sent back to the user in the cookie. This is
@@ -237,21 +237,21 @@ You can edit it multiple times.
accessed again from the user's browser (for example, the
:func:`django.contrib.auth.logout()` function calls it).
- .. method:: set_test_cookie
+ .. method:: set_test_cookie()
Sets a test cookie to determine whether the user's browser supports
cookies. Due to the way cookies work, you won't be able to test this
until the user's next page request. See `Setting test cookies`_ below for
more information.
- .. method:: test_cookie_worked
+ .. method:: test_cookie_worked()
Returns either ``True`` or ``False``, depending on whether the user's
browser accepted the test cookie. Due to the way cookies work, you'll
have to call ``set_test_cookie()`` on a previous, separate page request.
See `Setting test cookies`_ below for more information.
- .. method:: delete_test_cookie
+ .. method:: delete_test_cookie()
Deletes the test cookie. Use this to clean up after yourself.
@@ -280,7 +280,7 @@ You can edit it multiple times.
purposes. Session expiration is computed from the last time the
session was *modified*.
- .. method:: get_expiry_age
+ .. method:: get_expiry_age()
Returns the number of seconds until this session expires. For sessions
with no custom expiration (or those set to expire at browser close), this
@@ -295,7 +295,7 @@ You can edit it multiple times.
``None``. Defaults to the value stored in the session by
:meth:`set_expiry`, if there is one, or ``None``.
- .. method:: get_expiry_date
+ .. method:: get_expiry_date()
Returns the date this session will expire. For sessions with no custom
expiration (or those set to expire at browser close), this will equal the
@@ -303,17 +303,17 @@ You can edit it multiple times.
This function accepts the same keyword arguments as :meth:`get_expiry_age`.
- .. method:: get_expire_at_browser_close
+ .. method:: get_expire_at_browser_close()
Returns either ``True`` or ``False``, depending on whether the user's
session cookie will expire when the user's Web browser is closed.
- .. method:: clear_expired
+ .. method:: clear_expired()
Removes expired sessions from the session store. This class method is
called by :djadmin:`clearsessions`.
- .. method:: cycle_key
+ .. method:: cycle_key()
Creates a new session key while retaining the current session data.
:func:`django.contrib.auth.login()` calls this method to mitigate against
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index 8db371f7b6..49d4c10bbb 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -1036,7 +1036,7 @@ If ``multi_db=True``, fixtures are loaded into all databases.
Overriding settings
~~~~~~~~~~~~~~~~~~~
-.. method:: SimpleTestCase.settings
+.. method:: SimpleTestCase.settings()
For testing purposes it's often useful to change a setting temporarily and
revert to the original value after running the testing code. For this use case
@@ -1061,7 +1061,7 @@ Django provides a standard Python context manager (see :pep:`343`) called
This example will override the :setting:`LOGIN_URL` setting for the code
in the ``with`` block and reset its value to the previous state afterwards.
-.. method:: SimpleTestCase.modify_settings
+.. method:: SimpleTestCase.modify_settings()
.. versionadded:: 1.7