From be271d59eafab9d1ee027dcc62a94791012bf180 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 28 Feb 2023 17:25:42 +0100 Subject: [PATCH] fix test render --- ereuse_devicehub/inventory/views.py | 12 ++++++------ tests/test_render_2_0.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 26a4d6e1..835f95e6 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -1058,20 +1058,20 @@ class ExportsView(View): erasures.append(device.privacy) return erasures - def get_custum_details(self): + def get_costum_details(self): my_data = None customer_details = None if hasattr(g.user, 'sanitization_entity'): if g.user.sanitization_entity: my_data = list(g.user.sanitization_entity)[0] - if len(request.referrer.split('/lot/')) > 1: - try: + try: + if len(request.referrer.split('/lot/')) > 1: lot_id = request.referrer.split('/lot/')[-1].split('/')[0] lot = Lot.query.filter_by(owner=g.user).filter_by(id=lot_id).first() customer_details = lot.transfer.customer_details - except Exception: - pass + except Exception: + pass return my_data, customer_details def get_server_erasure_hosts(self, erasures): @@ -1094,7 +1094,7 @@ class ExportsView(View): erasures[0].snapshot.version, ) - my_data, customer_details = self.get_custum_details() + my_data, customer_details = self.get_costum_details() a, b = self.get_server_erasure_hosts(erasures) erasures_host, erasures_on_server = a, b diff --git a/tests/test_render_2_0.py b/tests/test_render_2_0.py index dc4a7cf2..c84ad143 100644 --- a/tests/test_render_2_0.py +++ b/tests/test_render_2_0.py @@ -320,7 +320,7 @@ def test_export_certificates(user3: UserClientFlask): body = str(next(body)) assert status == '200 OK' assert "PDF-1.5" in body - assert 'hts54322' in body + assert 'e2024242cv86mm'.upper() in body @pytest.mark.mvp