def setup(self):
     self.new_wine = Wine(name='Wine1')
     self.new_review = Review(wine=self.new_wine,
                              pub_date=datetime(2015, 1, 1, 12, 30, 59, 0),
                              user_name='admin',
                              comment='Best wine',
                              rating=4)
예제 #2
0
def save_wine_from_row(wine_row):
    wine = Wine()
    #wine.id = wine_row[0]
    wine.name = wine_row[0]
    #wine.CategoryR = wine_row[4]
    #wine.Stars = wine_row[5]
    wine.save()
예제 #3
0
def save_wine_from_row(wine_row):
    wine = Wine()
    wine.id = wine_row[1]
    wine.name = wine_row[2]
    wine.genres = wine_row[3]
    print(wine.id, wine.name, wine.genres)
    wine.save()
예제 #4
0
def save_wine_from_row(wine_row):
    wine = Wine()
    wine.id = wine_row[0]
    wine.name = wine_row[1]
    wine.country_origin = wine_row[3]
    wine.year = wine_row[2]
    wine.save()
예제 #5
0
def save_wine_from_row(wine_row):
    wine = Wine()
    wine.id = wine_row[0]
    wine.name = wine_row[1]
    wine.save()
def test_wine_clas_average_rating_called_with():
    new_wine = Wine()
    new_wine.average_rating = MagicMock(return_value=3)
    new_wine.average_rating()
    new_wine.average_rating.assert_called_with()
def test_wine_clas_max_rating_returned_value():
    new_wine = Wine()
    new_wine.max_rating = MagicMock(return_value=3)
    assert new_wine.max_rating() == 3
 def setup(self):
     self.new_wine = Wine(name='Wine1')