Skip to content

Commit

Permalink
Fix partitioned TransactionTestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
millerdev committed Jul 2, 2020
1 parent a69724e commit 4b6283f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion corehq/form_processor/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,11 @@ def patch_shard_db_transactions(cls):
This means that changes to shard dbs will not be rolled back at the
end of each test; test cleanup must be done manually.
:param cls: A subclass of `django.test.TestCase`
:param cls: A test class.
"""
from django.test import TestCase
if not issubclass(cls, TestCase):
return cls
assert hasattr(cls, "_enter_atomics") and hasattr(cls, "_rollback_atomics"), cls
shard_cfg = getattr(settings, "PARTITION_DATABASE_CONFIG", None)
if not shard_cfg:
Expand Down

0 comments on commit 4b6283f

Please sign in to comment.