Skip to content

Instantly share code, notes, and snippets.

@jkeyes
Created October 3, 2012 23:16
Show Gist options
  • Save jkeyes/3830501 to your computer and use it in GitHub Desktop.
Save jkeyes/3830501 to your computer and use it in GitHub Desktop.
Disabling and restoring Django transaction support in a TestCase
# See https://gist.github.com/3830479 for disable_ and restore_ functions
from unittest import TestCase
class Test(TestCase):
@classmethod
def class_setup(cls):
disable_transaction_methods()
# ... import test fixtures
@classmethod
def class_teardown(cls):
restore_transaction_methods()
def test_data_attributes(self):
# ...
def test_class_properties(self):
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment