misc: pylint fix anomalous-backslash-in-string (#52630)

This commit is contained in:
Lauréline Guérin 2021-04-02 14:59:09 +02:00
parent 5c49177e48
commit f93f513213
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
3 changed files with 11 additions and 11 deletions

View File

@ -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')

View File

@ -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():

View File

@ -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()