Skip to content

Commit

Permalink
Merge pull request #410 from podloucky-init/master
Browse files Browse the repository at this point in the history
Test that creating and deleting instance does not create version
  • Loading branch information
etianen committed Jun 1, 2015
2 parents 356b875 + 8758424 commit 3801815
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests/test_reversion/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ def testRevisionCreatedOnDelete(self):
self.assertEqual(Revision.objects.count(), 2)
self.assertEqual(Version.objects.count(), 5)

def testNoVersionForObjectCreatedAndDeleted(self):
with reversion.create_revision():
new_object = ReversionTestModel1.objects.create()
new_object.delete()
# No Revision and no Version should have been created.
self.assertEqual(Revision.objects.count(), 1)
self.assertEqual(Version.objects.count(), 4)


class ApiTest(RevisionTestBase):

Expand Down

0 comments on commit 3801815

Please sign in to comment.