def get_news_json(self): # Note: The news is not cached because we want the most recent # headlines. return external._lookup_nyt(self.name)
def nyt_json(): city_name = request.args.get('city') country_name = request.args.get('country') result = external._lookup_nyt(city_name, country_name) return jsonify({'nyt-json': result})
def test_nyt(): response = external._lookup_nyt("New York", country_name = "United States") assert(response['status'] == 'OK') # test_nyt 1