Skip to content

Commit

Permalink
Add more coverage for RequestsView().post
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCorbin committed Oct 27, 2022
1 parent 8b179a9 commit e88eeac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions project/tests/test_view_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ def test_get(self):
self.assertQuerysetEqual(context['options_paths'], RequestsView()._get_paths())
self.assertIn('results', context)

def test_post(self):
response = self.client.post(silky_reverse('requests'), {
'filter-overalltime-value': 100,
'filter-overalltime-typ': 'TimeSpentOnQueriesFilter',
})
context = response.context
self.assertTrue(dict_contains({
'filters': {
'overalltime': {'typ': 'TimeSpentOnQueriesFilter', 'value': 100, 'str': 'DB Time >= 100'}
},
}, context))
self.assertQuerysetEqual(context['options_paths'], RequestsView()._get_paths())
self.assertIn('results', context)


class TestGetObjects(TestCase):
def assertSorted(self, objects, sort_field):
Expand Down

0 comments on commit e88eeac

Please sign in to comment.