From b9d645642129c38064d65e8c0d6f0606cc9bb06c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste <bleme@pm.me> Date: Fri, 22 Feb 2019 10:58:29 +0100 Subject: [PATCH] update: Try to reproduce the error by completing a unit test case --- djangoldp/tests/tests_save.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/djangoldp/tests/tests_save.py b/djangoldp/tests/tests_save.py index 7e05496a..557e0070 100644 --- a/djangoldp/tests/tests_save.py +++ b/djangoldp/tests/tests_save.py @@ -15,6 +15,7 @@ class Save(TestCase): "ldp:contains": [ {"@id": "https://happy-dev.fr/skills/{}/".format(skill1.pk)}, {"@id": "https://happy-dev.fr/skills/{}/".format(skill2.pk), "title": "skill2 UP"}, + {"title": "skill3 NEW", "obligatoire":"obligatoire"}, ]} } @@ -27,9 +28,10 @@ class Save(TestCase): result = serializer.save() self.assertEquals(result.title, "job test") - self.assertIs(result.skills.count(), 2) + self.assertIs(result.skills.count(), 3) self.assertEquals(result.skills.all()[0].title, "skill1") # no change self.assertEquals(result.skills.all()[1].title, "skill2 UP") # title updated + self.assertEquals(result.skills.all()[2].title, "skill3 NEW") # creation on the fly def test_save_without_nested_fields(self): skill1 = Skill.objects.create(title="skill1", obligatoire="obligatoire") -- GitLab