summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index efa0188ff..99840ddaa 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -53,7 +53,8 @@ from ishtar_common.apps import admin_site
from ishtar_common.serializers import type_serialization, \
SERIALIZATION_VERSION, serialization_info, \
restore_serialized, conf_serialization, CONF_MODEL_LIST, \
- importer_serialization, IMPORT_MODEL_LIST, geo_serialization, GEO_MODEL_LIST
+ importer_serialization, IMPORT_MODEL_LIST, geo_serialization, \
+ GEO_MODEL_LIST, directory_serialization, DIRECTORY_MODEL_LIST
from ishtar_common.utils import post_save_geo, update_data, move_dict_data, \
rename_and_simplify_media_name, try_fix_file
@@ -681,6 +682,20 @@ class SerializationTest(TestCase):
self.create_geo_default()
self.generic_serialization_test(geo_serialization)
+ def create_directory_default(self):
+ org = models.Organization.objects.create(
+ name="Test",
+ organization_type=models.OrganizationType.objects.all()[0])
+ person = models.Person.objects.create(
+ name="Test", attached_to=org
+ )
+ models.Author.objects.create(
+ person=person, author_type=models.AuthorType.objects.all()[0])
+
+ def test_directory_serialization(self):
+ self.create_directory_default()
+ self.generic_serialization_test(directory_serialization)
+
def test_serialization_zip(self):
zip_filename = type_serialization(archive=True)
# only check the validity of the zip, the type content is tested above
@@ -787,6 +802,13 @@ class SerializationTest(TestCase):
# no geo restore
self.assertFalse(models.Town.objects.get(numero_insee="12345").center)
+ def test_directory_restore(self):
+ self.create_directory_default()
+ current_number, zip_filename = self.generic_restore_test_genzip(
+ DIRECTORY_MODEL_LIST, directory_serialization)
+ self.generic_restore_test(zip_filename, current_number,
+ DIRECTORY_MODEL_LIST)
+
class AccessControlTest(TestCase):
def test_administrator(self):