예제 #1
0
 def test_lza_exporter_marks_review_as_exported(self):
     data = [
         ('recensio_newspapera_summer_issue-2.xml',
          self.review_a,
          self.review_b),
     ]
     exporter = LZAExporter()
     self._do_export(exporter, data)
     self.assertTrue(exporter._is_exported(self.review_a))
예제 #2
0
    def test_lza_exporter_skips_review_if_already_exported(self):
        data = [
            ('recensio_newspapera_summer_issue-2.xml',
             self.review_a,
             self.review_b),
            ('recensio_newspaperb_summer_issue-2.xml',
             self.review_b,
             self.review_a),
        ]
        exporter = LZAExporter()
        exporter._set_exported(self.review_a)
        export_zip = self._do_export(exporter, data)
        files_in_zip = [f.filename for f in export_zip.filelist]

        self.assertNotIn(data[0][0], files_in_zip)
        pdf_path = '/'.join(
            self.review_a.getPhysicalPath()[2:]) + '.pdf'
        self.assertNotIn(
            pdf_path,
            [f.filename for f in export_zip.filelist])
예제 #3
0
 def test_lza_exporter_can_undo_mark_as_exported(self):
     exporter = LZAExporter()
     exporter._set_exported(self.review_a)
     exporter._set_exported(self.review_a, value=False)
     self.assertFalse(exporter._is_exported(self.review_a))