Skip to content

Commit

Permalink
to remove: increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofucci committed Jul 15, 2019
1 parent 5da98c0 commit 4005a30
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mtp_noms_ops/apps/security/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,31 @@ class SenderFormTestCase(SecurityFormTestCase):
form_class = SendersForm
api_list_path = '/senders/'

def test_check_sender_sort_code(self):
expected_data = {
'page': 1,
'ordering': '-prisoner_count',
'sender_name': '', 'sender_sort_code': '', 'sender_account_number': '', 'sender_roll_number': '',
'prison': [], 'prison_region': '', 'prison_population': '', 'prison_category': '',
'prisoner_count__gte': None, 'credit_count__gte': None, 'credit_total__gte': None,
'prisoner_count__lte': None, 'credit_count__lte': None, 'credit_total__lte': None,
'prison_count__gte': None, 'prison_count__lte': None,
'card_number_last_digits': '', 'source': 'bank_transfer', 'sender_email': '', 'sender_postcode': '',
}
with responses.RequestsMock() as rsps:
mock_prison_response(rsps)
mock_empty_response(rsps, self.api_list_path)
form = SendersForm(
self.request,
data={
'page': '1',
'source': 'bank_transfer',
},
)
self.assertTrue(form.is_valid())
self.assertDictEqual(form.cleaned_data, expected_data)
self.assertListEqual(form.get_object_list(), [])

def test_sender_list_blank_form(self):
expected_data = {
'page': 1,
Expand Down

0 comments on commit 4005a30

Please sign in to comment.