diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-06 10:55:14 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-06 10:55:14 +0200 |
commit | e2f4f113f4b3f5742c4b61707bfbe2d8fa6cca91 (patch) | |
tree | dfec52ee013945688f6cf89cd40859e9bf41ad85 /ishtar_common/tests.py | |
parent | 765b0197a138a9c051902c11a5f7e83e071f8b3b (diff) | |
download | Ishtar-e2f4f113f4b3f5742c4b61707bfbe2d8fa6cca91.tar.bz2 Ishtar-e2f4f113f4b3f5742c4b61707bfbe2d8fa6cca91.zip |
Serialization: add uuid to parcel owner - test that only natural keys are used
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 68c206865..aa67d2e6b 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -611,7 +611,13 @@ class GenericSerializationTest: module = importlib.import_module(module_name + ".models") model = getattr(module, model_name) current_count = model.objects.count() - serialization_count = len(json.loads(json_result[key])) + result = json.loads(json_result[key]) + serialization_count = len(result) + # all serialization have to be tested + self.assertTrue(serialization_count) + # only "natural" serialization + self.assertNotIn("pk", result[0]) + self.assertNotIn("id", result[0]) # has to be at least equal (can be superior for model with # recursion) self.assertTrue( |