Skip to content

Commit

Permalink
+ Tests for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
meteozond committed Jun 9, 2015
1 parent 575d155 commit b4eb055
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions django_permanent/tests/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b4eb055

Please sign in to comment.