X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..432f2258bdd1cfc4f902b499f9d4a816561be6a5:/src/api/tests.py diff --git a/src/api/tests.py b/src/api/tests.py index 94abe53b5..e02120de8 100644 --- a/src/api/tests.py +++ b/src/api/tests.py @@ -28,7 +28,7 @@ class ApiTest(TestCase): try: data = json.loads(content) except ValueError: - self.fail('No JSON could be decoded:', content) + self.fail('No JSON could be decoded: %s' % content) return data @@ -50,12 +50,12 @@ class BookTests(ApiTest): books = self.load_json('/api/authors/joe/books/') self.assertEqual([b['title'] for b in books], [self.book_tagged.title], - 'Wrong tagged book list.') + 'Wrong tagged book list.') def test_detail(self): book = self.load_json('/api/books/a-book/') self.assertEqual(book['title'], self.book.title, - 'Wrong book details.') + 'Wrong book details.') class TagTests(ApiTest): @@ -69,19 +69,21 @@ class TagTests(ApiTest): def test_tag_list(self): tags = self.load_json('/api/authors/') self.assertEqual(len(tags), 1, - 'Wrong tag list.') + 'Wrong tag list.') def test_tag_detail(self): tag = self.load_json('/api/authors/joe/') self.assertEqual(tag['name'], self.tag.name, - 'Wrong tag details.') + 'Wrong tag details.') class PictureTests(ApiTest): def test_publish(self): slug = "kandinsky-composition-viii" - xml = SimpleUploadedFile('composition8.xml', open(path.join(picture.tests.__path__[0], "files", slug + ".xml")).read()) - img = SimpleUploadedFile('kompozycja-8.png', open(path.join(picture.tests.__path__[0], "files", slug + ".png")).read()) + xml = SimpleUploadedFile( + 'composition8.xml', open(path.join(picture.tests.__path__[0], "files", slug + ".xml")).read()) + img = SimpleUploadedFile( + 'kompozycja-8.png', open(path.join(picture.tests.__path__[0], "files", slug + ".png")).read()) import_form = PictureImportForm({}, { 'picture_xml_file': xml,