summaryrefslogtreecommitdiff
path: root/tests/messages_tests/test_fallback.py
diff options
context:
space:
mode:
authorza <za@python.or.id>2016-10-27 14:53:39 +0700
committerTim Graham <timograham@gmail.com>2016-11-10 21:30:21 -0500
commit321e94fa41b121f65c02119c02098df327bbd569 (patch)
treece5476c191d589aca4b124f841dfbccac8dd299f /tests/messages_tests/test_fallback.py
parent4bb70cbcc60794f515c9bfefeca87b8272d33c0c (diff)
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
Diffstat (limited to 'tests/messages_tests/test_fallback.py')
-rw-r--r--tests/messages_tests/test_fallback.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/tests/messages_tests/test_fallback.py b/tests/messages_tests/test_fallback.py
index 647941b8b2..dfba0a2dc3 100644
--- a/tests/messages_tests/test_fallback.py
+++ b/tests/messages_tests/test_fallback.py
@@ -25,8 +25,7 @@ class FallbackTest(BaseTests, SimpleTestCase):
return storage.storages[-1]
def stored_cookie_messages_count(self, storage, response):
- return stored_cookie_messages_count(self.get_cookie_storage(storage),
- response)
+ return stored_cookie_messages_count(self.get_cookie_storage(storage), response)
def stored_session_messages_count(self, storage, response):
return stored_session_messages_count(self.get_session_storage(storage))
@@ -35,9 +34,10 @@ class FallbackTest(BaseTests, SimpleTestCase):
"""
Return the storage totals from both cookie and session backends.
"""
- total = (self.stored_cookie_messages_count(storage, response) +
- self.stored_session_messages_count(storage, response))
- return total
+ return (
+ self.stored_cookie_messages_count(storage, response) +
+ self.stored_session_messages_count(storage, response)
+ )
def test_get(self):
request = self.get_request()
@@ -52,7 +52,6 @@ class FallbackTest(BaseTests, SimpleTestCase):
# used (it would cause a TypeError: 'NoneType' object is not callable).
self.get_session_storage(storage)._get = None
- # Test that the message actually contains what we expect.
self.assertEqual(list(storage), example_messages)
def test_get_empty(self):
@@ -63,7 +62,6 @@ class FallbackTest(BaseTests, SimpleTestCase):
# used (it would cause a TypeError: 'NoneType' object is not callable).
self.get_session_storage(storage)._get = None
- # Test that the message actually contains what we expect.
self.assertEqual(list(storage), [])
def test_get_fallback(self):
@@ -74,11 +72,9 @@ class FallbackTest(BaseTests, SimpleTestCase):
# Set initial cookie and session data.
example_messages = [str(i) for i in range(5)]
- set_cookie_data(cookie_storage, example_messages[:4] +
- [CookieStorage.not_finished])
+ set_cookie_data(cookie_storage, example_messages[:4] + [CookieStorage.not_finished])
set_session_data(session_storage, example_messages[4:])
- # Test that the message actually contains what we expect.
self.assertEqual(list(storage), example_messages)
def test_get_fallback_only(self):
@@ -89,11 +85,9 @@ class FallbackTest(BaseTests, SimpleTestCase):
# Set initial cookie and session data.
example_messages = [str(i) for i in range(5)]
- set_cookie_data(cookie_storage, [CookieStorage.not_finished],
- encode_empty=True)
+ set_cookie_data(cookie_storage, [CookieStorage.not_finished], encode_empty=True)
set_session_data(session_storage, example_messages)
- # Test that the message actually contains what we expect.
self.assertEqual(list(storage), example_messages)
def test_flush_used_backends(self):
@@ -116,8 +110,6 @@ class FallbackTest(BaseTests, SimpleTestCase):
def test_no_fallback(self):
"""
- Confirms that:
-
(1) A short number of messages whose data size doesn't exceed what is
allowed in a cookie will all be stored in the CookieBackend.
@@ -142,8 +134,8 @@ class FallbackTest(BaseTests, SimpleTestCase):
def test_session_fallback(self):
"""
- Confirms that, if the data exceeds what is allowed in a cookie,
- messages which did not fit are stored in the SessionBackend.
+ If the data exceeds what is allowed in a cookie, messages which did
+ not fit are stored in the SessionBackend.
"""
storage = self.get_storage()
response = self.get_response()
@@ -161,8 +153,8 @@ class FallbackTest(BaseTests, SimpleTestCase):
def test_session_fallback_only(self):
"""
- Confirms that large messages, none of which fit in a cookie, are stored
- in the SessionBackend (and nothing is stored in the CookieBackend).
+ Large messages, none of which fit in a cookie, are stored in the
+ SessionBackend (and nothing is stored in the CookieBackend).
"""
storage = self.get_storage()
response = self.get_response()