def setup_books(cls):
        test_book_path = os.path.join(TEST_DATA_DIR, 'test_book.pdf')
        test_book_image_path = os.path.join(TEST_DATA_DIR, 'test_book_image.png')

        books_setup = [
            {
                'name': 'First Book',
                'author': cls.author1,
                'category': cls.category1,
                'language': cls.language_en,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'photo': SimpleUploadedFile('test_book_image.png', open(test_book_image_path, 'rb').read()),
                'who_added': cls.the_user1,
                'private': True
            },
            {
                'name': 'Second Book',
                'author': cls.author2,
                'category': cls.category1,
                'language': cls.language_en,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'who_added': cls.the_user2,
                'blocked_book': True
            },
            {
                'name': 'Third Book',
                'author': cls.author2,
                'category': cls.category1,
                'language': cls.language_ru,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'photo': SimpleUploadedFile('test_book_image.png', open(test_book_image_path, 'rb').read()),
                'who_added': cls.the_user1,
                'blocked_book': True
            },
            {
                'name': 'Fourth Book',
                'author': cls.author1,
                'category': cls.category1,
                'language': cls.language_ru,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'photo': SimpleUploadedFile('test_book_image.png', open(test_book_image_path, 'rb').read()),
                'who_added': cls.the_user2,
                'blocked_book': True
            },
            {
                'name': 'Fifth Book',
                'author': cls.author1,
                'category': cls.category2,
                'language': cls.language_ru,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'who_added': cls.the_user1,
                'private': True
            },
            {
                'name': 'Sixth Book',
                'author': cls.author2,
                'category': cls.category2,
                'language': cls.language_en,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'photo': SimpleUploadedFile('test_book_image.png', open(test_book_image_path, 'rb').read()),
                'who_added': cls.the_user2
            },
            {
                'name': 'Seventh Book<>&"',
                'author': cls.author4,
                'category': cls.category2,
                'language': cls.language_en,
                'file': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
                'photo': SimpleUploadedFile('test_book_image.png', open(test_book_image_path, 'rb').read()),
                'who_added': cls.the_user2
            }
        ]

        for book in books_setup:
            Book.objects.create(
                book_name=book['name'],
                id_author=book['author'],
                id_category=book['category'],
                description='TEST description',
                language=book['language'],
                book_file=book['file'],
                photo=book.get('photo', False),
                who_added=book['who_added'],
                private_book=book.get('private', False),
                blocked_book=book.get('blocked_book', False)
            )