From 1352fd1274896bc0fc5a495132babfb12b360d0c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 12 Sep 2019 12:05:12 +0200 Subject: Remove contenttype from serialization - instead force regen of content_types --- ishtar_common/tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ishtar_common/tests.py') diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 2cad1ef81..765d74312 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -628,7 +628,18 @@ class GenericSerializationTest: for key in json_result.keys(): __, k = key module_name, model_name = k.split("__") - module = importlib.import_module(module_name + ".models") + if module_name == "django": + if model_name in ("Group", "Permission"): + module = importlib.import_module( + "django.contrib.auth.models") + elif model_name in ("ContentType",): + module = importlib.import_module( + "django.contrib.contenttypes.models") + else: + return + else: + module = importlib.import_module(module_name + ".models") + model = getattr(module, model_name) current_count = model.objects.count() result = json.loads(json_result[key]) -- cgit v1.2.3