diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2013-11-23 19:05:13 +0100 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2013-11-23 19:05:13 +0100 |
| commit | 9e8744455286f9d28e7fb80838aa5fb1bf1d2719 (patch) | |
| tree | a2848d0f4d1a728a505996e949aa437ef74665bc | |
| parent | cf7ddc576583a15dec0800f4146c2e979795bf30 (diff) | |
Don't fail if cPickle doesn't exist.
Today is not my day :(
| -rw-r--r-- | tests/cache/tests.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py index bf1543ce8a..44524b0707 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -31,10 +31,14 @@ from django.utils import timezone from django.utils import translation from django.utils.cache import (patch_vary_headers, get_cache_key, learn_cache_key, patch_cache_control, patch_response_headers) -from django.utils.six.moves import cPickle as pickle from django.utils.encoding import force_text from django.views.decorators.cache import cache_page +try: # Use the same idiom as in cache backends + from django.utils.six.moves import cPickle as pickle +except ImportError: + import pickle + from .models import Poll, expensive_calculation |
