X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7583035c199c378c8d019937d155992709536b91..0bd51a33b9ffe994541ccd02fc850d47ac82ccec:/apps/api/tests.py?ds=inline diff --git a/apps/api/tests.py b/apps/api/tests.py index 518a3e2c0..87c4f75d8 100644 --- a/apps/api/tests.py +++ b/apps/api/tests.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from os import path from django.core.files.uploadedfile import SimpleUploadedFile @@ -14,7 +16,8 @@ import picture.tests @override_settings( - API_WAIT=-1, + API_WAIT=-1, + NO_SEARCH_INDEX = True, 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'}} @@ -33,10 +36,10 @@ class ChangesTest(ApiTest): book.save() changes = json.loads(self.client.get('/api/changes/0.json?book_fields=title&tag_fields=name').content) - self.assertEqual(changes['updated']['books'], + self.assertEqual(changes['updated']['books'], [{'id': book.id, 'title': book.title}], 'Invalid book format in changes') - self.assertEqual(changes['updated']['tags'], + self.assertEqual(changes['updated']['tags'], [{'id': tag.id, 'name': tag.name}], 'Invalid tag format in changes') @@ -155,5 +158,4 @@ class PictureTests(ApiTest): if import_form.is_valid(): import_form.save() - pic = Picture.objects.get(slug=slug) - + Picture.objects.get(slug=slug)