Exemplo n.º 1
0
    def test_get_businesses_from_yelp(self):
        """ Can we build list of YelpBusiness objects? """

        location = "San Francisco"
        business_list = get_businesses_from_yelp(location)
        self.assertIsInstance(business_list[0], YelpBusiness)
        self.assertEqual(business_list[0].biz_name, 'ImagiKnit')
Exemplo n.º 2
0
def show_local():
    """ Show local page with Yelp map results and group meeting events.
        :return: rendered template
     """

    user = verify_login(session)
    if not user:
        return redirect("/")

    location = 'San Francisco'
    business_list = get_businesses_from_yelp(location)
    group_events = GroupEvent.query.all()

    return render_template("local.html",
                           business_list=business_list,
                           groups=group_events)