def test_sending_application_and_version(self): msg = MessageT1() header = msg.header() self.assertEqual(u'4teamwork AG', header.sendingApplication.manufacturer) self.assertEqual(u'OneGov GEVER', header.sendingApplication.product) self.assertRegexpMatches(header.sendingApplication.productVersion, r'\d{4}\.\d+\.\d', msg="Doesn't look like a version number")
def test_adding_to_zip(self): msg = MessageT1() msg.add_object(self.dossier) msg.add_object(self.document) zipfile = DummyZipFile() msg.add_to_zip(zipfile) self.assertEqual([ u'files/dossier-1/dossier-2/ubersicht-der-vertrage-von-2016.xlsx', u'files/dossier-1/vertragsentwurf.docx', u'files/dossier-1/die-burgschaft.eml', u'files/dossier-1/testm\xe4il.msg', u'files/vertragsentwurf.docx' ], zipfile.arcnames)
def test_adding_to_zip(self): msg = MessageT1() msg.add_object(self.dossier) msg.add_object(self.document) zipfile = DummyZipFile() msg.add_to_zip(zipfile) self.assertEqual( [ u'files/dossier-1/dossier-2/ubersicht-der-vertrage-von-2016.xlsx', u'files/dossier-1/vertragsentwurf.docx', u'files/dossier-1/initialvertrag-fur-bearbeitung-8-sitzung-der.docx', # noqa u'files/vertragsentwurf.docx' ], zipfile.arcnames)
def test_adding_to_zip(self): msg = MessageT1() msg.add_object(self.dossier) msg.add_object(self.document) zipfile = DummyZipFile() msg.add_to_zip(zipfile) expected_files = [ u'files/dossier-1/dossier-2/dossier-4/Uebersicht der Vertraege von 2014.xlsx', u'files/dossier-1/dossier-2/Uebersicht der Vertraege von 2016.xlsx', u'files/dossier-1/Vertraegsentwurf.docx', u'files/dossier-1/Die Buergschaft.eml', u'files/dossier-1/testm\xe4il.msg', u'files/dossier-1/Initialvertrag fuer Bearbeitung.docx', u'files/Vertraegsentwurf.docx', ] self.assertEqual(expected_files, zipfile.arcnames)
def test_message_with_comments(self): msg = MessageT1() msg.comments = [u'A comment'] self.assertTrue(msg.binding().validateBinding()) header = msg.header() self.assertEqual(u'A comment', header.comments.comment[0].value())
def test_message_with_subjects(self): msg = MessageT1() msg.subjects = [u'A Subject'] self.assertTrue(msg.binding().validateBinding()) header = msg.header() self.assertEqual(u'A Subject', header.subjects.subject[0].value())
def test_adding_a_dossier(self): msg = MessageT1() msg.add_object(self.dossier) self.assertEqual(1, len(msg.dossiers)) self.assertEqual(self.dossier, msg.dossiers[0].obj) self.assertTrue(msg.binding().validateBinding())
def test_senderid_defaults_to_current_users_email(self): member = api.user.get_current() member.setProperties({'email': '*****@*****.**'}) msg = MessageT1() header = msg.header() self.assertEqual(u'*****@*****.**', header.senderId)
def test_binding_of_empty_message_is_valid(self): msg = MessageT1() self.assertTrue(msg.binding().validateBinding())