From f93f5132135f6b2f29c886c11b6fb3268ad847cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 2 Apr 2021 14:59:09 +0200
Subject: [PATCH 12/18] misc: pylint fix anomalous-backslash-in-string (#52630)

---
 tests/backoffice_pages/test_all.py | 16 ++++++++--------
 tests/test_publisher.py            |  4 ++--
 tests/test_sql.py                  |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tests/backoffice_pages/test_all.py b/tests/backoffice_pages/test_all.py
index d68488f3..f897d54e 100644
--- a/tests/backoffice_pages/test_all.py
+++ b/tests/backoffice_pages/test_all.py
@@ -1860,7 +1860,7 @@ def test_backoffice_map(pub):
     number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0]
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
 
     # check there's no link to map the sidebar
     assert 'Plot on a Map' not in resp.text
@@ -1932,7 +1932,7 @@ def test_backoffice_handling(pub):
     number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0]
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
 
     # check sidebar links are ok
     assert 'Statistics' in resp.text
@@ -2030,7 +2030,7 @@ def test_backoffice_submission_context(pub):
     number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0]
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
 
     # click on a formdata
     resp = resp.click(href='%s/' % number31.id)
@@ -2130,7 +2130,7 @@ def test_backoffice_geolocation_info(pub):
     number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0]
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
 
     # click on a formdata
     resp = resp.click(href='%s/' % number31.id)
@@ -2271,7 +2271,7 @@ def test_backoffice_handling_post_dispatch(pub):
     resp = app.get('/backoffice/management/').follow()
     assert 'form-title/' in resp.text
     resp = app.get('/backoffice/management/form-title/', status=200)
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 1
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 1
 
     # check statistics and exports are also available
     assert 'Statistics' in resp.text
@@ -3399,7 +3399,7 @@ def test_backoffice_sidebar_user_context(pub):
     number31 = [x for x in form_class.select() if x.data['1'] == 'FOO BAR 30'][0]
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    assert re.findall('<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
+    assert re.findall(r'<tbody.*\/tbody>', resp.text, re.DOTALL)[0].count('<tr') == 17
 
     # click on a formdata
     resp = resp.click(href='%s/' % number31.id)
@@ -3719,7 +3719,7 @@ def test_backoffice_backoffice_submission_in_listings(pub):
 
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    first_link = re.findall('data-link="(\d+)/?"', resp.text)[0]
+    first_link = re.findall(r'data-link="(\d+)/?"', resp.text)[0]
     assert 'backoffice-submission' not in resp.text
 
     formdata = FormDef.get_by_urlname('form-title').data_class().get(first_link)
@@ -3766,7 +3766,7 @@ def test_backoffice_advisory_lock(pub):
 
     app = login(get_app(pub))
     resp = app.get('/backoffice/management/form-title/')
-    first_link = re.findall('data-link="(\d+/)?"', resp.text)[0]
+    first_link = re.findall(r'data-link="(\d+/)?"', resp.text)[0]
     assert 'advisory-lock' not in resp.text
 
     app2 = login(get_app(pub), username='foobar', password='foobar')
diff --git a/tests/test_publisher.py b/tests/test_publisher.py
index 41f7304f..11f642cb 100644
--- a/tests/test_publisher.py
+++ b/tests/test_publisher.py
@@ -60,14 +60,14 @@ def test_plaintext_error():
     assert re.findall('^foo.*bar', s, re.MULTILINE)
     assert re.findall('^SERVER_NAME.*www.example.net', s, re.MULTILINE)
     assert re.findall('File.*?line.*?in test_plaintext_error', s)
-    assert re.findall('^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE)
+    assert re.findall(r'^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE)
 
     pub.USE_LONG_TRACES = False
     s = pub._generate_plaintext_error(req, None, exc_type, exc_value, tb)
     assert re.findall('^foo.*bar', s, re.MULTILINE)
     assert re.findall('^SERVER_NAME.*www.example.net', s, re.MULTILINE)
     assert re.findall('File.*?line.*?in test_plaintext_error', s)
-    assert not re.findall('^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE)
+    assert not re.findall(r'^>.*\d+.*s = pub._generate_plaintext_error', s, re.MULTILINE)
 
 
 def test_finish_failed_request():
diff --git a/tests/test_sql.py b/tests/test_sql.py
index 4f8a1e43..71aca878 100644
--- a/tests/test_sql.py
+++ b/tests/test_sql.py
@@ -1122,7 +1122,7 @@ def test_migration_2_formdef_id_in_views():
     cur.execute(
         '''SELECT table_name FROM information_schema.views
                    WHERE table_name LIKE %s''',
-        ('wcs\_view\_%',),
+        ('wcs_view_%',),
     )
     while True:
         row = cur.fetchone()
-- 
2.30.2

