summaryrefslogtreecommitdiff
path: root/tests/regressiontests/cache
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2011-10-13 18:51:33 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2011-10-13 18:51:33 +0000
commitd362c1546f8ad62811e5dee3cf0b43170e6e1c4c (patch)
treec14af91e991cb534a135cc0ca467aa6263007b07 /tests/regressiontests/cache
parentd5a45d79fe03cad93ab5761860e9bb6fc1db4c86 (diff)
Convert much of the regression tests to use absolute imports. There's still work to be done though.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/cache')
-rw-r--r--tests/regressiontests/cache/liberal_backend.py1
-rw-r--r--tests/regressiontests/cache/models.py4
-rw-r--r--tests/regressiontests/cache/tests.py4
3 files changed, 6 insertions, 3 deletions
diff --git a/tests/regressiontests/cache/liberal_backend.py b/tests/regressiontests/cache/liberal_backend.py
index cc15b66465..b72013c6a8 100644
--- a/tests/regressiontests/cache/liberal_backend.py
+++ b/tests/regressiontests/cache/liberal_backend.py
@@ -1,5 +1,6 @@
from django.core.cache.backends.locmem import LocMemCache
+
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
diff --git a/tests/regressiontests/cache/models.py b/tests/regressiontests/cache/models.py
index 643fd22629..31b988a86d 100644
--- a/tests/regressiontests/cache/models.py
+++ b/tests/regressiontests/cache/models.py
@@ -1,6 +1,8 @@
-from django.db import models
from datetime import datetime
+from django.db import models
+
+
def expensive_calculation():
expensive_calculation.num_runs += 1
return datetime.now()
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index 07bcab7fbc..33ed4d7c7e 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -2,7 +2,7 @@
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
-from __future__ import with_statement
+from __future__ import with_statement, absolute_import
import hashlib
import os
@@ -29,7 +29,7 @@ from django.utils.cache import (patch_vary_headers, get_cache_key,
learn_cache_key, patch_cache_control, patch_response_headers)
from django.views.decorators.cache import cache_page
-from regressiontests.cache.models import Poll, expensive_calculation
+from .models import Poll, expensive_calculation
# functions/classes for complex data type tests
def f():