def test_get_related_objects_for_create(self):
        test_book_path = os.path.join(TEST_DATA_DIR, 'test_book.pdf')

        form_data = {
            'bookname': 'The new book',
            'author': 'trueAuthorNew',
            'category': 'category1',
            'language': 'English',
            'about': 'about book',
            'bookfile': SimpleUploadedFile('test_book.pdf', open(test_book_path, 'rb').read()),
        }

        form_data_new_author = copy.deepcopy(form_data)
        form_data_new_author['author'] = 'super new author'

        self.assertEqual(Author.objects.all().count(), 5)

        form = AddBookForm(data=form_data)
        form.is_valid()
        form_with_new_author = AddBookForm(data=form_data_new_author)
        form_with_new_author.is_valid()

        related_data = Book.get_related_objects_for_create(self.user1.id, form)

        self.assertTrue(isinstance(related_data, BookRelatedData))
        self.assertEqual(len(related_data), 4)
        self.assertEqual(related_data.author, Author.objects.get(author_name='trueAuthorNew'))
        self.assertEqual(Author.objects.all().count(), 5)

        related_data_new_author = Book.get_related_objects_for_create(self.user1.id, form_with_new_author)

        self.assertTrue(isinstance(related_data, BookRelatedData))
        self.assertEqual(len(related_data_new_author), 4)
        self.assertEqual(related_data_new_author.author, Author.objects.get(author_name='super new author'))
        self.assertEqual(Author.objects.all().count(), 6)