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 | 790dd38d55c7edc83a3f73e13ba00310042a57b2 (patch) | |
tree | dfec52ee013945688f6cf89cd40859e9bf41ad85 /ishtar_common | |
parent | d99e961414c0c15812bbc583253008550079ccc8 (diff) | |
download | Ishtar-790dd38d55c7edc83a3f73e13ba00310042a57b2.tar.bz2 Ishtar-790dd38d55c7edc83a3f73e13ba00310042a57b2.zip |
Serialization: add uuid to parcel owner - test that only natural keys are used
Diffstat (limited to 'ishtar_common')
-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( |