diff options
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index f2bb390bd..8ca14179f 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1124,6 +1124,38 @@ class RegisterTest(TestCase, OperationInitTest): z.close() f.close() + def test_document_migration(self): + fe = FileInit() + fe.create_file() + + from archaeological_files.tests import create_administrativact as ca_fle + ca_fle(self.user, fe.item) + + tpl = open( + settings.ROOT_PATH + + '../ishtar_common/tests/old.odt', + 'rb') + template = SimpleUploadedFile(tpl.name, tpl.read()) + doc = DocumentTemplate.objects.create( + name="Old", + associated_object_name=DocumentTemplate.CLASSNAMES[0][0], + available=True, + template=template + ) + self.act_types[0].associated_template.add(doc) + + doc.convert_from_v1() + with open(doc.template.path) as f: + try: + z = zipfile.ZipFile(f) + self.assertIsNone(z.testzip()) + c = z.open('content.xml') + content = c.read() + self.assertIn('{{ adminact_operator_id }}', content) + finally: + c.close() + z.close() + class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase): fixtures = [settings.ROOT_PATH + |