X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f59e7c3de6bd0f85a61a4d9481db60cd7369ae92..af8e6768e9a3129f9df5c562ffe8a1905581b624:/apps/api/tests.py diff --git a/apps/api/tests.py b/apps/api/tests.py index 74417acb9..fe8e70f62 100644 --- a/apps/api/tests.py +++ b/apps/api/tests.py @@ -1,30 +1,26 @@ # -*- coding: utf-8 -*- -from datetime import datetime +from os import path +from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase +from django.test.utils import override_settings from django.utils import simplejson as json -from django.conf import settings -from api.helpers import timestamp from catalogue.models import Book, Tag -from picture.tests.utils import RequestFactory from picture.forms import PictureImportForm from picture.models import Picture import picture.tests -from django.core.files.uploadedfile import SimpleUploadedFile - -from os import path +@override_settings( + API_WAIT=-1, + CACHES = {'api': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}, + 'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}, + 'permanent': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}} +) class ApiTest(TestCase): - - def setUp(self): - self.old_api_wait = settings.API_WAIT - settings.API_WAIT = -1 - - def tearDown(self): - settings.API_WAIT = self.old_api_wait + pass class ChangesTest(ApiTest): @@ -160,3 +156,4 @@ class PictureTests(ApiTest): import_form.save() pic = Picture.objects.get(slug=slug) +