diff --git a/django_permanent/tests/cases.py b/django_permanent/tests/cases.py index de3340b..8f1c010 100644 --- a/django_permanent/tests/cases.py +++ b/django_permanent/tests/cases.py @@ -154,6 +154,18 @@ def test_m2m_deleted_through(self): PermanentM2MThrough.objects.create(m2m_from=_from, m2m_to=_to, removed=now()) self.assertEqual(M2MFrom.objects.filter(m2mto__id=_to.pk).count(), 0) + def test_save_removed(self): + self.permanent.delete() + self.permanent.name = 'new name' + self.permanent.save() + self.assertEqual(MyPermanentModel.all_objects.get(pk=self.permanent.pk).name, 'new name') + + def test_save_removed_update_fields(self): + self.permanent.delete() + self.permanent.name = 'new name' + self.permanent.save(update_fields=['name']) + self.assertEqual(MyPermanentModel.all_objects.get(pk=self.permanent.pk).name, 'new name') + class TestPassThroughManager(TestCase): @skipUnless(model_utils, "Missing django-model-utils")