Use the new django transaction API

fixes #1027
Why do we need this test?