def test_dossier_contains_documents_and_mails(self): documentish_types = ['opengever.document.document', 'ftw.mail.mail'] dossier = Dossier(self.dossier, u'files') self.assertItemsEqual([ d for d in self.dossier.objectValues() if d.portal_type in documentish_types ], [d.obj for d in dossier.documents])
def test_dossier_contains_documents_and_mails(self): dossier = Dossier(self.dossier, u'files') dossier_objects = self.dossier.objectValues() expected_mails = [ d for d in dossier_objects if d.portal_type == 'ftw.mail.mail' ] expected_documents = [ d for d in dossier_objects if d.portal_type == 'opengever.document.document' and d.file ] self.assertItemsEqual(expected_mails + expected_documents, [d.obj for d in dossier.documents])
def test_dossier_binding_is_valid(self): dossier = Dossier(self.dossier, u'files') self.assertTrue(dossier.binding().validateBinding())
def test_dossier_contains_subdossiers(self): dossier = Dossier(self.dossier, u'files') self.assertItemsEqual([ d.getId() for d in self.dossier.objectValues() if d.portal_type == 'opengever.dossier.businesscasedossier' ], [d.obj.getId() for d in dossier.dossiers])
def test_documents_without_a_file_are_skipped(self): dossier = Dossier(self.dossier, u'files') self.assertNotIn(self.empty_document, [d.obj for d in dossier.documents])
def test_dossier_path_consists_of_base_path_and_dossier_id(self): base_path = u'myfiles/folder' dossier = Dossier(self.dossier, base_path) self.assertEqual(base_path + '/' + self.dossier.getId(), dossier.path)
def test_dossier_contains_documents(self): dossier = Dossier(self.dossier, u'files') self.assertItemsEqual([ d for d in self.dossier.objectValues() if d.portal_type == 'opengever.document.document' ], [d.obj for d in dossier.documents])