[IMP] report_qr: black, isort

This commit is contained in:
Joan Sisquella
2020-03-02 10:59:46 +01:00
committed by Kiplangat Dan
parent 1a52e3dab5
commit ba66252734
4 changed files with 41 additions and 45 deletions

View File

@@ -5,17 +5,16 @@ from odoo.tests.common import HttpCase
class TestReportQr(HttpCase):
def test_qr_generation(self):
data = 'TEST'
image = self.url_open('/report/qr?value=%s' % data)
self.assertEqual(image.headers['Content-type'], 'image/png')
data = "TEST"
image = self.url_open("/report/qr?value=%s" % data)
self.assertEqual(image.headers["Content-type"], "image/png")
def test_qr_overflow(self):
"""There is a QR limitation for 4296 characters, we will test that an
Exception is raised"""
new_data = ''
new_data = ""
for i in range(0, 1500):
new_data += 'TEST'
new_data += "TEST"
with self.assertRaises(Exception):
self.env['ir.actions.report'].qr_generate(new_data)
self.env["ir.actions.report"].qr_generate(new_data)