Skip to content

Commit

Permalink
add test case for grants method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jer-Sch committed Sep 23, 2021
1 parent 48e9400 commit 655ad77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/grants/tests/models/test_grant_clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def test_grants_method_calls_filter_with_expected_parameters(self):
def test_grants_method_calls_filter_with_expected_parameters_if_collection_filters_are_present(self):
grant_clr = GrantCLRFactory()
grant_clr.collection_filters={'1': GrantCollectionFactory()}
grants = Grant.objects.filter(hidden=False, active=True, is_clr_eligible=True, link_to_new_grant=None)

with patch.object(GrantCollection.objects, 'filter') as filter:
with patch.object(GrantCollection.objects.filter(**grant_clr.collection_filters), 'values_list') as values_list:
Expand All @@ -218,7 +219,7 @@ def test_grants_method_does_not_call_filter_if_collection_filters_are_not_presen
grant_clr.grants

filter.assert_not_called
values_list.assert_not_called
values_list.assert_not_called

def test_record_clr_prediction_curve_calls_collaborator_with_expected_parameters(self):
"""Test record_clr_prediction_curve calls create on GrantCLRCalculation.objects with expected params."""
Expand Down

0 comments on commit 655ad77

Please sign in to comment.