misc: fix tests/test_lingo_remote_regie.py pylint error (#56288)
This commit is contained in:
parent
b8d98ef862
commit
bb1487919a
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue