コード例 #1
0
 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))
コード例 #2
0
ファイル: views.py プロジェクト: npalombo/harrison_question_1
def detail(request, state):
    all_geodata = fetch.get_data_for_state(state)
    return render(request, 'detail.html', {'state': state, 'all_geodata': all_geodata})
コード例 #3
0
 def _test_bad_state_exception(self):
     return fetch.get_data_for_state("FOOBAR")