Added a test for multiple memcached servers in LOCATION.

This commit is contained in:
Ed Morley 2016-08-31 18:14:29 +01:00 committed by Tim Graham
parent 59afe61a97
commit c8058dc241
1 changed files with 10 additions and 0 deletions

10
tests/cache/tests.py vendored
View File

@ -1156,6 +1156,16 @@ memcached_excluded_caches = {'cull', 'zero_cull'}
class BaseMemcachedTests(BaseCacheTests):
def test_location_multiple_servers(self):
locations = [
['server1.tld', 'server2:11211'],
'server1.tld;server2:11211',
]
for location in locations:
params = {'BACKEND': self.base_params['BACKEND'], 'LOCATION': location}
with self.settings(CACHES={'default': params}):
self.assertEqual(cache._servers, ['server1.tld', 'server2:11211'])
def test_invalid_key_characters(self):
"""
On memcached, we don't introduce a duplicate key validation