Example #1
0
 def test_update_with_a_zero_rating(self):
     """
     Ensure that if a rating is updated with zero, the overall rating returned is
     equal to zero
     """
     overall = Rating.update(self.expedition, self.paltman, rating=0, category=self.speed)
     self.assertEquals(overall, Decimal("0"))
Example #2
0
 def test_update_with_a_zero_rating(self):
     """
     Ensure that if a rating is updated with zero, the overall rating returned is
     equal to zero
     """
     overall = Rating.update(self.expedition,
                             self.paltman,
                             rating=0,
                             category=self.speed)
     self.assertEquals(overall, Decimal("0"))
Example #3
0
 def create_rating(self, user, rating, obj=None, category=""):
     """
     Helper function to post a rating for the benz object of
     type Car used in the tests
     :param user: User
     :param rating: int
     :param obj: obj
     :param category: str
     :return: http response object
     """
     if not obj:
         obj = self.expedition
     cat_choice = category_value(obj, category)
     if not cat_choice:
         cat_choice = ""
     Rating.update(rating_object=obj,
                   user=user,
                   category=cat_choice,
                   rating=rating)
Example #4
0
 def create_rating(self, user, rating, obj=None, category=""):
     """
     Helper function to post a rating for the benz object of
     type Car used in the tests
     :param user: User
     :param rating: int
     :param obj: obj
     :param category: str
     :return: http response object
     """
     if not obj:
         obj = self.expedition
     cat_choice = category_value(obj, category)
     if not cat_choice:
         cat_choice = ""
     Rating.update(
         rating_object=obj,
         user=user,
         category=cat_choice,
         rating=rating
     )
Example #5
0
 def test_rating(self):
     overall = Rating.update(self.bronco, self.paltman, rating=5)
     self.assertEquals(overall, Decimal("5"))
     overall = Rating.update(self.bronco, self.jtauber, rating=2)
     self.assertEquals(overall, Decimal("3.5"))
Example #6
0
 def test_rating(self):
     overall = Rating.update(self.bronco, self.paltman, rating=5)
     self.assertEquals(overall, Decimal("5"))
     overall = Rating.update(self.bronco, self.jtauber, rating=2)
     self.assertEquals(overall, Decimal("3.5"))