Remove uses of .assert_not_called

I prefer to avoid `assert_not_called`, because if I make a typo like
this, the tests will still pass:
```
    app.invite_api_client.create_invite.asset_not_called()
```

It’s harder to have a false positive with the statement written this
way:
```
    assert app.invite_api_client.create_invite.called is False
```
This commit is contained in:
Chris Hill-Scott
2020-08-28 13:26:14 +01:00
parent d446a91a8e
commit 1e55a8cbbe
8 changed files with 29 additions and 29 deletions

View File

@@ -92,7 +92,7 @@ def test_update_letter_branding_with_new_valid_file(
assert page.select_one('#name').attrs.get('value') == 'HM Government'
assert mock_s3_upload.called
mock_delete_temp_files.assert_not_called()
assert mock_delete_temp_files.called is False
def test_update_letter_branding_when_uploading_invalid_file(
@@ -163,7 +163,7 @@ def test_update_letter_branding_with_original_file_and_new_details(
assert response.status_code == 200
assert page.find('h1').text == 'Letter branding'
mock_upload_logos.assert_not_called()
assert mock_upload_logos.called is False
mock_client_update.assert_called_once_with(
branding_id=fake_uuid,
@@ -343,7 +343,7 @@ def test_create_letter_branding_when_uploading_valid_file(
assert page.select_one('#logo-img > img').attrs['src'].endswith(expected_temp_filename)
assert mock_s3_upload.called
mock_delete_temp_files.assert_not_called()
assert mock_delete_temp_files.called is False
def test_create_letter_branding_fails_validation_when_uploading_SVG_with_embedded_image(
@@ -372,7 +372,7 @@ def test_create_letter_branding_fails_validation_when_uploading_SVG_with_embedde
assert page.findAll('div', {'id': 'logo-img'}) == []
mock_s3_upload.assert_not_called()
assert mock_s3_upload.called is False
def test_create_letter_branding_when_uploading_invalid_file(platform_admin_client):