Skip to content

Commit

Permalink
Add test for observations filters endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
eheinrich committed Sep 1, 2020
1 parent 1f7e831 commit a35ae49
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions observation_portal/observations/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1638,3 +1638,14 @@ def test_with_one_obs_command_reports_dry_run_doesnt_modify_time(self):
self.assertIn('is different from existing', command_err.getvalue())
self.time_allocation.refresh_from_db()
self.assertEqual(self.time_allocation.std_time_used, 0)


class TestGetObservationsFiltersApi(APITestCase):
def setUp(self) -> None:
super().setUp()

def test_get_observations_filters(self):
response = self.client.get(reverse('api:observations-filters'))
self.assertEqual(response.status_code, 200)
self.assertGreater(len(response.json()['choice_fields'][0]['options']), 0)
self.assertGreater(len(response.json()['fields']), 0)

0 comments on commit a35ae49

Please sign in to comment.