misc: fix tests/test_lingo_remote_regie.py pylint error (#56288)

This commit is contained in:
Lauréline Guérin 2021-08-30 12:03:20 +02:00
parent b8d98ef862
commit bb1487919a
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 9 additions and 4 deletions

View File

@ -546,25 +546,30 @@ def test_self_declared_invoice(mock_get, app, remote_regie):
resp = app.get('/test-self-invoice/')
resp = resp.form.submit().follow()
assert 'Sorry, no invoice were found with that number and amount.'
assert 'Sorry, the provided amount is invalid.' in resp
resp = app.get('/test-self-invoice/')
resp.form['invoice-number'] = 'F201601'
resp.form['invoice-amount'] = 'FOOBAR' # wrong format
resp = resp.form.submit().follow()
assert 'Sorry, the provided amount is invalid.'
assert 'Sorry, the provided amount is invalid.' in resp
mock_json = mock.Mock(status_code=404)
mock_get.return_value = mock_json
resp = app.get('/test-self-invoice/')
resp.form['invoice-number'] = 'F201602' # invalid number
resp.form['invoice-amount'] = '123.45'
resp = resp.form.submit().follow()
assert 'Sorry, no invoice were found with that number and amount.'
assert 'Sorry, no invoice were found with that number and amount.' in resp
mock_json = mock.Mock()
mock_json.json.return_value = {'err': 0, 'data': INVOICES[0]}
mock_get.return_value = mock_json
resp = app.get('/test-self-invoice/')
resp.form['invoice-number'] = 'F201601'
resp.form['invoice-amount'] = '123.46' # invalid amount
resp = resp.form.submit().follow()
assert 'Sorry, no invoice were found with that number and amount.'
assert 'Sorry, no invoice were found with that number and amount.' in resp
resp = app.get('/test-self-invoice/')
resp.form['invoice-number'] = 'F201601'