예제 #1
0
def test_csv_reports_have_good_stuff():
    order = _create_test_order()
    csv_report_data = get_code_report("csv", False).decode(settings.DEFAULT_CHARSET)
    # We don't particularly care if we have extra orders/codes at this point, just as long
    # as the ones we just created are found
    for code in order.code_set.all():
        assert (code.literate_code in csv_report_data), "code %r was missing" % code
예제 #2
0
def test_all_report_formats_seem_to_work():
    _create_test_order()
    formats = [n.split("_")[1] for n in dir(CodeReportWriter) if n.startswith("format_")]
    for format in formats:
        assert get_code_report(format, False, True)
        assert get_code_report(format, True, False)