Merge branch 'testing' into feature/server-side-render-parser-3021

This commit is contained in:
Cayo Puigdefabregas 2022-05-05 18:52:59 +02:00
commit eca2795857
3 changed files with 0 additions and 32 deletions

View File

@ -422,7 +422,6 @@ class ExportsView(View):
'metrics': self.metrics,
'devices': self.devices_list,
'certificates': self.erasure,
'links': self.public_links,
}
if export_id not in export_ids:
@ -498,19 +497,6 @@ class ExportsView(View):
return self.response_csv(data, "actions_export.csv")
def public_links(self):
# get a csv with the publink links of this devices
data = StringIO()
cw = csv.writer(data, delimiter=';', lineterminator="\n", quotechar='"')
cw.writerow(['links'])
host_url = request.host_url
for dev in self.find_devices():
code = dev.devicehub_id
link = [f"{host_url}devices/{code}"]
cw.writerow(link)
return self.response_csv(data, "links.csv")
def erasure(self):
template = self.build_erasure_certificate()
res = flask_weasyprint.render_pdf(

View File

@ -201,12 +201,6 @@
Metrics Spreadsheet
</a>
</li>
<li>
<a href="javascript:export_file('links')" class="dropdown-item">
<i class="bi bi-link-45deg"></i>
Public Links
</a>
</li>
<li>
<a href="javascript:export_file('certificates')" class="dropdown-item">
<i class="bi bi-eraser-fill"></i>

View File

@ -243,18 +243,6 @@ def test_export_metrics(user3: UserClientFlask):
assert body == ''
@pytest.mark.mvp
@pytest.mark.usefixtures(conftest.app_context.__name__)
def test_export_links(user3: UserClientFlask):
snap = create_device(user3, 'real-eee-1001pxd.snapshot.12.json')
uri = "/inventory/export/links/?ids={id}".format(id=snap.device.devicehub_id)
body, status = user3.get(uri)
assert status == '200 OK'
body = body.split("\n")
assert ['links', 'http://localhost/devices/O48N2', ''] == body
@pytest.mark.mvp
@pytest.mark.usefixtures(conftest.app_context.__name__)
def test_export_certificates(user3: UserClientFlask):