Пример #1
0
    def test_complete(self):
        contents = {
            "manifest": "manifest.xml",
            "henvendelse": "vedtak_melding_m_vedlegg.xml",
            "recipients": "recipients.xml",
            "attachments": self.pdf_attachment_list,
            "subfolder": "vedtak"
        }
        package_data = BrregTestPackage(**contents)
        result = package.BrregPackage(file_data=package_data.zip)

        expected_inq = new_inquiry.BrregNewInquiry(
            xml=package_data.henvendelse)
        self.assertEqual(result.inquiry.to_xml(), expected_inq.to_xml())

        expected_rec = recipients.BrregRecipientList(
            xml=package_data.recipients)
        self.assertEqual(result.recipients.to_xml(), expected_rec.to_xml())

        expected_manifest = manifest.BrregManifest(xml=package_data.manifest)
        self.assertEqual(result.manifest.to_xml(), expected_manifest.to_xml())

        for att in package_data.attachments:
            inq_att = result.get_attachment(att.filename)
            self.assertEqual(inq_att.file_data, att.file_data)
Пример #2
0
 def test_get_content_app_receipt(self):
     document = new_inquiry.BrregNewInquiry(xml=self.application_receipt)
     result = document.get_content()
     self.assertIsInstance(result,
                           application_receipt.BrregApplicationReceipt)
Пример #3
0
 def test_get_content_decree(self):
     document = new_inquiry.BrregNewInquiry(xml=self.decree)
     result = document.get_content()
     self.assertIsInstance(result, decree.BrregDecree)
Пример #4
0
 def test_sdo_from_dict(self):
     document = new_inquiry.BrregNewInquiry(**self.sdo_inquiry_data)
     xml = document.to_xml()
     generated.melding.CreateFromDocument(xml)
Пример #5
0
 def test_application_receipt_from_xml(self):
     document = new_inquiry.BrregNewInquiry(xml=self.application_receipt)
     xml = document.to_xml()
     generated.melding.CreateFromDocument(xml)
Пример #6
0
 def test_decree_from_xml(self):
     document = new_inquiry.BrregNewInquiry(xml=self.decree)
     xml = document.to_xml()
     generated.melding.CreateFromDocument(xml)