Skip to content

Commit

Permalink
fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jenriordan committed Feb 7, 2025
1 parent b21cbbb commit ec0b6c0
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ def test_is_third_party(self, patched_clean_data, patched_save_to_db, authentica


class TestDownloadPDFView:
@pytest.mark.django_db
@patch("apply_for_a_licence.models.Licence.objects.get", return_value=MagicMock())
@patch("apply_for_a_licence.views.views_end.BaseDownloadPDFView", return_value=MagicMock())
@patch("apply_for_a_licence.views.views_end.Licence", return_value=MagicMock())
def test_successful_get(self, mock_licence, mock_download):
mock_licence.objects.return_value.get.return_value = MagicMock()
def test_successful_get(self, mock_download, mock_licence):
print(mock_licence)
test_reference = "DE1234"
request = RequestFactory().get("?reference=" + test_reference)

Expand All @@ -93,4 +92,3 @@ def test_successful_get(self, mock_licence, mock_download):
expected_response = HttpResponse(status=200)
assert response.status_code == expected_response.status_code
mock_licence.assert_called_with(reference=test_reference)
mock_download.assert_called_once()

0 comments on commit ec0b6c0

Please sign in to comment.