From d33bf12a910a7a10ccaeb93d0dee99c7386c9a20 Mon Sep 17 00:00:00 2001 From: Thomas Achtemichuk Date: Thu, 20 Aug 2020 14:49:58 -0400 Subject: [PATCH] Update test to fail correctly --- tests/test_model_serializer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_model_serializer.py b/tests/test_model_serializer.py index a8ab6d0f2..023e43ca6 100644 --- a/tests/test_model_serializer.py +++ b/tests/test_model_serializer.py @@ -1336,6 +1336,7 @@ class Issue7489Parent(models.Model): class Issue7489Child(models.Model): parent = models.ForeignKey(Issue7489Parent, on_delete=models.CASCADE) stage = models.CharField(max_length=1, choices=(('A', 'A'), ('B', 'B')), default='A') + is_thing = models.BooleanField(default=False) class Meta: unique_together = ('parent', 'stage') @@ -1357,5 +1358,5 @@ class IssueTest(TestCase): parent = Issue7489Parent.objects.create() Issue7489Child.objects.create(parent=parent, stage='A') child_b = Issue7489Child.objects.create(parent=parent, stage='B') - serializer = Issue7489ChildSerializer(instance=child_b) + serializer = Issue7489ChildSerializer(instance=child_b, data={'is_thing': True}) self.assertTrue(serializer.is_valid(), serializer.errors)