Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit 267158f

Browse files
committed
Turn off page caching in test mode
This fixes errors like the following: self = <web.tests.test_event_views.EventViewsTestCase testMethod=test_index_view_without_approved_events> def test_index_view_without_approved_events(self): response = self.client.get( reverse('web.index'), {}, REMOTE_ADDR='93.103.53.11') print(repr(settings.CACHES)) self.assertEquals(200, response.status_code) > self.assertEquals((46.0, 15.0), response.context['lan_lon']) E TypeError: 'NoneType' object has no attribute '__getitem__' web/tests/test_event_views.py:65: TypeError More info: http://stackoverflow.com/questions/14392537/django-unit-test-client-response-has-empty-context
1 parent 32c4e0d commit 267158f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

codeweekeu/settings_testing.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from settings import *
2+
3+
USE_TZ = False
4+
from settings import *
5+
6+
USE_TZ = False
7+
DEBUG = True
8+
TEMPLATE_DEBUG = DEBUG
9+
10+
CACHES = {
11+
'default': {
12+
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
13+
}
14+
}

codeweekeu/settings_travis.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)