Esempio n. 1
0
    def test_to_table(self):

        site = USite.objects.create(name="site")
        unit = utils.create_unit(site=site)
        utils.create_unit_test_collection(unit=unit)

        tlm = utils.create_test_list_membership()
        unit2 = utils.create_unit(site=None)
        utils.create_unit_test_collection(unit=unit2,
                                          test_collection=tlm.test_list)

        rep = qc.AssignedQCReport(report_opts={'active': True})
        rep.report_format = "csv"
        context = rep.get_context()
        table = rep.to_table(context)

        header_row = table.index([
            _("Site"),
            _("Unit"),
            _("Test list (Cycle)"),
            _("Frequency"),
            _("Assigned To"),
            _("Link"),
        ])
        assert len(table[header_row + 1:]) == 2
Esempio n. 2
0
    def test_generate_summary_html(self):
        site = USite.objects.create(name="site")
        unit = utils.create_unit(site=site)
        utils.create_unit_test_collection(unit=unit)

        rep = qc.AssignedQCReport()
        rep.report_format = "pdf"
        rep.to_html()
Esempio n. 3
0
 def test_get_unit_details(self):
     site = USite.objects.create(name="site")
     unit = utils.create_unit(site=site)
     units = qc.AssignedQCReport().get_unit_details([unit.pk])
     assert units == ('Unit(s)', '%s - %s' % (unit.site.name, unit.name))
Esempio n. 4
0
 def test_get_unit__site_details(self):
     site = USite.objects.create(name="site")
     sites = qc.AssignedQCReport().get_unit__site_details([site, 'null'])
     assert sites == ('Site(s)', 'site, Other')
Esempio n. 5
0
 def test_get_filename(self):
     assert qc.AssignedQCReport().get_filename(
         'pdf') == 'qc-assignment-summary.pdf'
Esempio n. 6
0
 def test_get_queryset(self):
     assert qc.AssignedQCReport().get_queryset(
     ).model._meta.model_name == "unittestcollection"