Ejemplo n.º 1
0
    def test_review_replies(self):
        """
        Make sure that developer replies are not returned as if they were
        original reviews.
        """
        addon = Addon.objects.get(id=3615)
        u = UserProfile.objects.get(pk=2519)
        version = addon.get_version()
        new_review = Review(version=version,
                            user=u,
                            rating=2,
                            body='hello',
                            addon=addon)
        new_review.save()
        new_reply = Review(version=version,
                           user=u,
                           reply_to=new_review,
                           addon=addon,
                           body='my reply')
        new_reply.save()

        review_list = [r.pk for r in u.reviews]

        assert len(review_list) == 1
        assert new_review.pk in review_list, (
            'Original review must show up in review list.')
        assert new_reply.pk not in review_list, (
            'Developer reply must not show up in review list.')
Ejemplo n.º 2
0
    def test_review_replies(self):
        """
        Make sure that developer replies are not returned as if they were
        original reviews.
        """
        addon = Addon.objects.get(id=3615)
        u = UserProfile.objects.get(pk=2519)
        version = addon.get_version()
        new_review = Review(version=version, user=u, rating=2, body='hello',
                            addon=addon)
        new_review.save()
        new_reply = Review(version=version, user=u, reply_to=new_review,
                           addon=addon, body='my reply')
        new_reply.save()

        review_list = [r.pk for r in u.reviews]

        eq_(len(review_list), 1)
        assert new_review.pk in review_list, (
            'Original review must show up in review list.')
        assert new_reply.pk not in review_list, (
            'Developer reply must not show up in review list.')
Ejemplo n.º 3
0
 def log_review(self, num):
     r = Review(addon=self.addon)
     for i in xrange(num):
         amo.log(amo.LOG.ADD_REVIEW, self.addon, r)
Ejemplo n.º 4
0
 def log_review(self, num):
     review = Review(addon=self.addon)
     for i in xrange(num):
         ActivityLog.create(amo.LOG.ADD_REVIEW, self.addon, review)