etianen/django-reversion — Issue #125: Tests fail when auth.User is registered
Author: duplico
Created: 2012-02-03 21:20:45+00:00
State: open

In 1.5.1, when auth.User is registered with reversion, the following tests all fail, all on Version.objects.count() calls, because they have one more revision than expected. This is partially fixed in head of master (or whatever an hg person should call the "tip" in git land), but only for testCreateInitialRevisions.

* testCreateInitialRevisions
* testCreateInitialRevisionsSpecificApps
* testRelationsFollowed
* testReverseRelationsFollowed
* testContextManager
* testCorrectVersionFlags
* testEmptyRevisionNotCreated
* testRevisionContextAbandonedOnError
* testRevisionDecoratorAbandonedOnError
* testRevisionsCreated

Unregistering auth.User causes these tests to pass. It's almost certainly caused by the test user created on or around tests.py:120.

I believe this to be a superset of #110 and #116, and the fix is similar. Alternatively, ReversionTestBase could get a version/revision count offset attribute that is set to 1 if User is registered, then use that to bias the tests above.

I'll try to write a patch soon, but for the moment I figured issue plus no patch was better than neither issue nor patch.