Exemple #1
0
def setup_function(function):
  cuisine = Cuisine(name="vietnamese")
  cuisine.save()
  restaurant = Restaurant(name="tu lan", location="123 address", cuisine=cuisine)
  restaurant.save()
  food = Food(**{
      "name": "Pho bo",
      "cuisine": cuisine,
      "restaurant": restaurant,
      "price": 8.75,
      "avgRating": 4.5,
      "numRating": 10
    })
  food.save()
  userChew = User(user="******")
  userChew.save()
  userHungry = User(user="******")
  userHungry.save()
  review = Review(**{
    "food": food,
    "text": "Wow this was delicious!",
    "user": userChew,
    "foodRating": 4,
    "reviewRating": 0,
    })
  review.save()
  reviewTwo = Review(**{
    "food": food,
    "text": "Wow this was delicious!",
    "user": userHungry,
    "foodRating": 4,
    "reviewRating": 0,
    })
  reviewTwo.save()
  function.parametrize(review);
def setup_function(function):
  Food.objects.all.delete()
  cuisine = Cuisine(name="vietnamese")
  cuisine.save()
  restaurant = Restaurant(name="tu lan", location="123 address", cuisine=cuisine)
  restaurant.save()
  food = Food(**{
      "name": "Pho bo",
      "cuisine": cuisine,
      "restaurant": restaurant,
      "price": 8.75,
      "avgRating": 4.5,
      "numRating": 10
    })
  food.save()
def setup_function(function):
  Food.objects.all.delete()
  cuisine = Cuisine(name="vietnamese")
  cuisine.save()
  restaurant = Restaurant(name="tu lan", location="123 address", cuisine=cuisine)
  restaurant.save()
  food = Food(**{
      "name": "Pho bo",
      "cuisine": cuisine,
      "restaurant": restaurant,
      "price": 8.75,
      "avgRating": 4.5,
      "numRating": 10
    })
  food.save()
  function.parametrize(food)
def setup_function(function):
  cuisine = Cuisine(name="vietnamese")
  cuisine.save()
  restaurant = Restaurant(name="tu lan", location="123 address", cuisine=cuisine)
  restaurant.save()
  food = Food(**{
      "name": "Pho bo",
      "cuisine": cuisine,
      "restaurant": restaurant,
      "price": 8.75,
      "avgRating": 4.5,
      "numRating": 10
    })
  food.save()
  image = Image(**{
    "food": food,
    "image": "/images/001.jpg",
    })
  image.save()
  function.parametrize(image);
Exemple #5
0
def setup_function(function):
    cuisine = Cuisine(name="vietnamese")
    cuisine.save()
    restaurant = Restaurant(name="tu lan",
                            location="123 address",
                            cuisine=cuisine)
    restaurant.save()
    food = Food(
        **{
            "name": "Pho bo",
            "cuisine": cuisine,
            "restaurant": restaurant,
            "price": 8.75,
            "avgRating": 4.5,
            "numRating": 10
        })
    food.save()
    image = Image(**{
        "food": food,
        "image": "/images/001.jpg",
    })
    image.save()
    function.parametrize(image)
Exemple #6
0
 def test_create_com(self):
     rest = Restaurant(restaurant_ID=14214)
     rest.save()
     com = Comment(review_ID=51453, rating=3, price=3, restaurant=rest)
     com.save()
     self.assertTrue(com)
Exemple #7
0
 def test_rest_default_location(self):
     rest = Restaurant(restaurant_ID=14351)
     rest.save()
     self.assertEqual(((rest.lat, rest.lng)), (55.8642, -4.2518))
Exemple #8
0
 def test_create_rest(self):
     rest1 = Restaurant(restaurant_ID=14214)
     rest1.save()
     self.assertTrue(rest1)