From 714d5d7e54dcb0b141954fc9775b4011a54b62bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 18 Mar 2022 12:31:05 +0100
Subject: [PATCH 12/65] misc: fix singleton-comparison pylint error (#62099)

---
 tests/test_arpege_ecp.py     |  4 ++--
 tests/test_astregs.py        | 12 ++++++------
 tests/test_iparapheur.py     |  2 +-
 tests/test_proxylogger.py    |  4 ++--
 tests/test_sms.py            |  2 +-
 tests/test_toulouse_smart.py |  4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tests/test_arpege_ecp.py b/tests/test_arpege_ecp.py
index 05545a3f..5927a905 100644
--- a/tests/test_arpege_ecp.py
+++ b/tests/test_arpege_ecp.py
@@ -142,8 +142,8 @@ def test_get_user_forms(mocked_post, mocked_get, app, connector):
         )
         assert item['form_receipt_datetime'] == '2018-05-11T09:50:46'
         assert item['form_receipt_time'] == '09:50:46'
-        assert item['readable'] == True
-        assert item['form_status_is_endpoint'] == False
+        assert item['readable'] is True
+        assert item['form_status_is_endpoint'] is False
 
 
 @mock.patch('passerelle.utils.Request.get')
diff --git a/tests/test_astregs.py b/tests/test_astregs.py
index cab28cb4..b2c3acf7 100644
--- a/tests/test_astregs.py
+++ b/tests/test_astregs.py
@@ -142,20 +142,20 @@ def test_check_association_presence(mocked_post, mocked_get, connector, app):
         content=response_content, status_code=200, headers={'Content-Type': 'text/xml'}
     )
     resp = app.get('/astregs/test/check-association-by-siret', params={'siret': '50043390900014'})
-    assert resp.json['exists'] == True
+    assert resp.json['exists'] is True
     response_content = get_xml_file('RechercheTiersNoResult.xml')
     mocked_post.return_value = mock.Mock(
         content=response_content, status_code=200, headers={'Content-Type': 'text/xml'}
     )
     resp = app.get('/astregs/test/check-association-by-siret', params={'siret': 'unknown'})
-    assert resp.json['exists'] == False
+    assert resp.json['exists'] is False
 
 
 @mock.patch('passerelle.utils.Request.get', side_effect=search_wsdl_side_effect)
 @mock.patch('passerelle.utils.Request.post', side_effect=contact_search_side_effect)
 def test_association_linking_means(mocked_post, mocked_get, client, connector, app):
     resp = app.get('/astregs/test/get-association-link-means', params={'association_id': '42'})
-    assert resp.json['already_paired'] == False
+    assert resp.json['already_paired'] is False
     assert resp.json['data'] == [
         {
             'id': 'email',
@@ -172,7 +172,7 @@ def test_association_linking_means(mocked_post, mocked_get, client, connector, a
     resp = app.get(
         '/astregs/test/get-association-link-means', params={'association_id': '42', 'NameID': 'user_name_id'}
     )
-    assert resp.json['already_paired'] == True
+    assert resp.json['already_paired'] is True
 
     for bad_mobile_number in ('', '01 43 35 01 35', '00 33 7 01 02 03 04', 'letters', '06 01 02'):
         mocked_post.side_effect = [
@@ -227,9 +227,9 @@ def test_link_user_to_association(
     assert link.association_label == '50043390900016 - ASSOCIATION OMNISPORTS DES MONTS D AZUR'
     assert resp.json['association_id'] == link.association_id
     assert resp.json['link'] == link.pk
-    assert resp.json['created'] == True
+    assert resp.json['created'] is True
     resp = app.get('/astregs/test/link', params={'association_id': '42', 'NameID': 'user_name_id'})
-    assert resp.json['created'] == False
+    assert resp.json['created'] is False
 
 
 @mock.patch('passerelle.utils.Request.get', side_effect=search_wsdl_side_effect)
diff --git a/tests/test_iparapheur.py b/tests/test_iparapheur.py
index cf624f05..793e3d02 100644
--- a/tests/test_iparapheur.py
+++ b/tests/test_iparapheur.py
@@ -115,7 +115,7 @@ def test_call_ping_connectionerror(soap_client, app, conn):
     url += '?apikey=%s' % API_KEY
     resp = app.get(url)
     assert resp.json['err'] == 1
-    assert resp.json['data'] == None
+    assert resp.json['data'] is None
     assert 'mocked error' in resp.json['err_desc']
 
 
diff --git a/tests/test_proxylogger.py b/tests/test_proxylogger.py
index 4d022bbe..697ec366 100644
--- a/tests/test_proxylogger.py
+++ b/tests/test_proxylogger.py
@@ -300,8 +300,8 @@ def test_logged_requests_and_responses_max_size(app, db, monkeypatch, settings):
     service_headers = {'Content-Type': 'foo/bar'}
 
     # default configuration
-    assert connector.logging_parameters.requests_max_size == None
-    assert connector.logging_parameters.responses_max_size == None
+    assert connector.logging_parameters.requests_max_size is None
+    assert connector.logging_parameters.responses_max_size is None
     with tests.utils.mock_url(URL, service_response, headers=service_headers):
         app.post(url, params=user_payload, status=200)
     assert len(ResourceLog.objects.all()) == 3
diff --git a/tests/test_sms.py b/tests/test_sms.py
index 68f66856..c99c81c4 100644
--- a/tests/test_sms.py
+++ b/tests/test_sms.py
@@ -56,7 +56,7 @@ def test_authorize_numbers():
     connector = OVHSMSGateway()
 
     # premium-rate
-    assert connector.allow_premium_rate == False
+    assert connector.allow_premium_rate is False
     number = '0033' + '8' + '12345678'
     with pytest.raises(APIError, match='no phone number was authorized: %s' % number):
         connector.authorize_numbers([number])
diff --git a/tests/test_toulouse_smart.py b/tests/test_toulouse_smart.py
index 8b61d76f..86cc614d 100644
--- a/tests/test_toulouse_smart.py
+++ b/tests/test_toulouse_smart.py
@@ -840,7 +840,7 @@ def test_update_intervention_job_transport_error(mocked_uuid, app, freezer, smar
     job = Job.objects.get(method_name='update_intervention_job')
     assert job.status == 'registered'
     smart_request = smart.wcs_requests.get(uuid=UUID).smart_requests.get()
-    assert smart_request.result == None
+    assert smart_request.result is None
 
     freezer.move_to('2021-07-08 00:00:03')
     smart.jobs()
@@ -848,7 +848,7 @@ def test_update_intervention_job_transport_error(mocked_uuid, app, freezer, smar
     assert job.status == 'registered'
     assert job.update_timestamp > job.creation_timestamp
     smart_request = smart.wcs_requests.get(uuid=UUID).smart_requests.get()
-    assert smart_request.result == None
+    assert smart_request.result is None
 
 
 ADD_MEDIA_PAYLOAD = {
-- 
2.34.1

