예제 #1
0
 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")
예제 #2
0
    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)
예제 #3
0
 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)
예제 #4
0
    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)
예제 #5
0
 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())
예제 #6
0
 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())
예제 #7
0
 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())
예제 #8
0
 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)
예제 #9
0
 def test_binding_of_empty_message_is_valid(self):
     msg = MessageT1()
     self.assertTrue(msg.binding().validateBinding())