def get_results(self, form): results = get_flights( origin=form.cleaned_data['origin'], destination=form.cleaned_data['destination'], departure_date=form.cleaned_data['departure_date'], show_many=form.cleaned_data['show_many'] ) return self.render_to_response(self.get_context_data(results=results))
def test_show_many(self): results = get_flights("SFO", "NYC", date.today(), show_many=True) self.assertEquals(len(results), 15)