def test_get_state(self): """ Get the data for state IL. A list of dictionary objects should be returned. """ geodata = fetch.get_data_for_state("IL") self.assertIsNotNone(geodata) self.assertTrue(isinstance(geodata, list)) self.assertTrue(len(geodata) > 0) self.assertTrue(isinstance(geodata[0], dict))
def detail(request, state): all_geodata = fetch.get_data_for_state(state) return render(request, 'detail.html', {'state': state, 'all_geodata': all_geodata})
def _test_bad_state_exception(self): return fetch.get_data_for_state("FOOBAR")