def test_changed_book_rating(self):
        removed_rating = BookRating.objects.get(id_book=Book.objects.get(book_name='Third Book'),
                                                id_user=self.the_user1)
        removed_rating.delete()
        self.assertEqual(BookRating.objects.all().count(), 5)

        changed_rating1 = BookRating.objects.get(id_book=Book.objects.get(book_name='Second Book'),
                                                 id_user=self.the_user2)
        changed_rating2 = BookRating.objects.get(id_book=Book.objects.get(book_name='Fourth Book'),
                                                 id_user=self.the_user1)

        self.assertEqual(BookRating.objects.filter(rating=7).count(), 2)
        self.assertEqual(changed_rating1.rating, 7)
        self.assertEqual(changed_rating2.rating, 7)

        changed_rating1.rating = 4
        changed_rating1.save()

        changed_rating2.rating = 3
        changed_rating2.save()

        self.assertEqual(changed_rating1.rating, 4)
        self.assertEqual(changed_rating2.rating, 3)
        self.assertEqual(BookRating.objects.filter(rating=7).count(), 0)
        self.assertEqual(BookRating.objects.filter(rating=4).count(), 2)
        self.assertEqual(BookRating.objects.filter(rating=3).count(), 2)