def test_fill_metadata_of_new_mail(self): mail = self.create_mail() self.assertEquals(u'', mail.description) self.assertEquals((), mail.keywords, 'Expected no keywords') self.assertIsNone(mail.foreign_reference, 'Foreign reference should have no value') self.assertEquals(get_header_date(mail).date(), mail.document_date) self.assertEquals(date.today(), mail.receipt_date) self.assertIsNone(mail.delivery_date, 'Delivery date should have no value') self.assertIsNone(mail.document_type, 'Document type should have no value') self.assertTrue(mail.digitally_available, 'Digitally available should be True') self.assertEquals(get_preserved_as_paper_default(), mail.preserved_as_paper) self.assertIsNone(mail.archival_file, 'Archival file should have no value') self.assertIsNone(mail.thumbnail, 'Thumbnail should have no value') self.assertIsNone(mail.preview, 'Preview should have no value')
def test_mail_overview_tab(self, browser): mail = create(Builder('mail') .with_asset_message( 'mail_with_multiple_attachments.eml')) browser.login().visit(mail, view='tabbedview_view-overview') expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], ['Message', u'Mehrere Anhaenge.eml \u2014 32 KB ' u'Checkout and edit Download copy Attach to email'], ['Attachments', u'Inneres Testma\u0308il ohne Attachments.eml 1 KB ' 'word_document.docx 22.4 KB ' 'Text.txt 1 KB ' 'Save attachments'], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())
def test_mail_overview_tab(self, browser): mail = create( Builder('mail').with_asset_message( 'mail_with_multiple_attachments.eml')) browser.login().visit(mail, view='tabbedview_view-overview') view = mail.restrictedTraverse('tabbedview_view-overview') if not view.is_preview_supported(): # Unexpected preconditions, print debug output for CI tests print "view.is_preview_supported() is unexpectedly False!" from opengever.base.pdfconverter import is_pdfconverter_enabled print "is_pdfconverter_enabled(): %r" % is_pdfconverter_enabled() import pkg_resources dist = pkg_resources.get_distribution('opengever.pdfconverter') print( "pkg_resources.get_distribution" "('opengever.pdfconverter'): %r" % dist) from opengever.bumblebee import is_bumblebee_feature_enabled print("is_bumblebee_feature_enabled(): " "%r" % is_bumblebee_feature_enabled()) expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], [ 'Original message', u'mehrere-anhange.eml \u2014 32 KB ' u'Checkout and edit Download copy' ], [ 'Attachments', 'Inneres Testma?il ohne Attachments.eml 1 KB ' 'word_document.docx 22.4 KB ' 'Text.txt 1 KB ' 'Save attachments' ], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())
def test_mail_overview_tab(self, browser): mail = create(Builder('mail') .with_asset_message( 'mail_with_multiple_attachments.eml')) browser.login().visit(mail, view='tabbedview_view-overview') view = mail.restrictedTraverse('tabbedview_view-overview') if not view.is_preview_supported(): # Unexpected preconditions, print debug output for CI tests print "view.is_preview_supported() is unexpectedly False!" from opengever.base.pdfconverter import is_pdfconverter_enabled print "is_pdfconverter_enabled(): %r" % is_pdfconverter_enabled() import pkg_resources dist = pkg_resources.get_distribution('opengever.pdfconverter') print("pkg_resources.get_distribution" "('opengever.pdfconverter'): %r" % dist) from opengever.bumblebee import is_bumblebee_feature_enabled print ("is_bumblebee_feature_enabled(): " "%r" % is_bumblebee_feature_enabled()) expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], ['Original message', u'mehrere-anhange.eml \u2014 32 KB ' u'Checkout and edit Download copy'], ['Attachments', 'Inneres Testma?il ohne Attachments.eml 1 KB ' 'word_document.docx 22.4 KB ' 'Text.txt 1 KB ' 'Save attachments'], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())
def test_mail_overview_tab(self, browser): mail = create(Builder("mail").with_message(MAIL_DATA)) browser.login().visit(mail, view='tabbedview_view-overview') expect = [['Document Date', date_format_helper(get_header_date(mail))], ['Document Type', ''], ['Author', get_author_by_email(mail)], ['creator', 'Test User (test_user_1_)'], ['Description', ''], ['Foreign Reference', ''], ['Original message', u'die-burgschaft.eml \u2014 1 KB Download copy'], ['Digital Available', 'yes'], ['Preserved as paper', 'yes'], ['Date of receipt', date_format_helper(date.today())], ['Date of delivery', ''], ['Classification', 'unprotected'], ['Privacy layer', 'privacy_layer_no'], ['Public Trial', 'unchecked'], ['Public trial statement', '']] self.assertEquals(expect, browser.css('table').first.lists())