Example #1
0
    def setUp(self):
        super().setUp()
        self.restaurant = f.RestaurantFactory(lat=23.11122, lon=-2343.222)
        self.restaurant_create_or_listing_url = reverse('restaurant-create-list')
        self.restaurant_detail_url = reverse(
            'restaurant-detail', args=(self.restaurant.id,)
        )

        self.restaurant_payload = {
            'name': 'Sagar Ratna',
            'lat': '23.37483',
            'lon': '-483.3245',
            'address': 'South Delhi'
        }

        self.restaurant_vote_up_url = reverse(
            'restaurant-vote', args=(self.restaurant.id, 'up')
        )

        self.restaurant_vote_down_url = reverse(
            'restaurant-vote', args=(self.restaurant.id, 'down')
        )

        self.restaurant_thumbdown_url = reverse(
            'restaurant-thumbdown', args=(self.restaurant.id,)
        )

        self.restaurant_visited_url = reverse(
            'restaurant-visited', args=(self.restaurant.id,)
        )
Example #2
0
 def setUp(self):
     super().setUp()
     self.restaurant = f.RestaurantFactory(lat=23.11122, lon=-2343.222)
     self.review_post_url = reverse('review-create',
                                    args=(self.restaurant.id, ))
     self.review_payload = {
         'text': 'This is dummy review',
         'user': self.user.profile.id,
         'restaurant': self.restaurant.id
     }
def test_comment_model_method_works(db, method):
    user = f.UserFactory(email='*****@*****.**', password='******')
    restaurant = f.RestaurantFactory(lat=23.2223443, lon=-243.222334)
    review = f.ReviewFactory(restaurant=restaurant, user=user.profile)
    comment = f.CommentFactory(review=review, user=user.profile)
    assert getattr(comment, method)
def test_restaurant_model_method_works(db, method):
    restaurant = f.RestaurantFactory(lat=23.2223443, lon=-243.222334)
    assert getattr(restaurant, method)
def test_visit_model_method_works(db, method):
    user = f.UserFactory(email='*****@*****.**', password='******')
    restaurant = f.RestaurantFactory(lat=23.2223443, lon=-243.222334)
    visit = f.VisitFactory(user=user.profile, restaurant=restaurant)
    assert getattr(visit, method)