summaryrefslogtreecommitdiff
path: root/django_testscenarios/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'django_testscenarios/tests.py')
-rw-r--r--django_testscenarios/tests.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/django_testscenarios/tests.py b/django_testscenarios/tests.py
index ebf68b3..f9a1318 100644
--- a/django_testscenarios/tests.py
+++ b/django_testscenarios/tests.py
@@ -121,6 +121,8 @@ class TestsWorkWithTestToolsTestCase(TestCase,
* plain database checks
* test tools test case
"""
+ def __hash__(self):
+ return hash(repr(self))
class TestsWorkWithTestScenariosTestCaseAndNoScenarios(TestCaseWithScenarios,
@@ -132,6 +134,8 @@ class TestsWorkWithTestScenariosTestCaseAndNoScenarios(TestCaseWithScenarios,
* test scenarios test case
* no actual scenarios (short-circuited fast path)
"""
+ def __hash__(self):
+ return hash(repr(self))
class TestsWorkWithTestScenariosTestCaseAndSomeScenarios(TestCaseWithScenarios,
@@ -144,6 +148,8 @@ class TestsWorkWithTestScenariosTestCaseAndSomeScenarios(TestCaseWithScenarios,
* test scenarios test case
* two dummy scenarios so that multiple test cases get generated
"""
+ def __hash__(self):
+ return hash(repr(self))
# Transaction tests
@@ -157,6 +163,8 @@ class TransactionsWorkWithPlainDjangoTestCase(DjangoTransactionTestCase,
* database transactions
* django test case (with transaction support)
"""
+ def __hash__(self):
+ return hash(repr(self))
class TransactionsWorkWithTestToolsTestCase(TransactionTestCase,
@@ -167,6 +175,8 @@ class TransactionsWorkWithTestToolsTestCase(TransactionTestCase,
* database transactions
* test tools test case (with transaction support)
"""
+ def __hash__(self):
+ return hash(repr(self))
class TransactionsWorkWithTestScenariosTestCaseAndNoScenarios(TransactionTestCaseWithScenarios,
@@ -179,6 +189,8 @@ class TransactionsWorkWithTestScenariosTestCaseAndNoScenarios(TransactionTestCas
* test scenarios test case (with transaction support)
* no actual scenarios (short-circuited fast path)
"""
+ def __hash__(self):
+ return hash(repr(self))
class TransactionsWorkWithTestScenariosTestCaseAndSomeScenarios(TransactionTestCaseWithScenarios,
@@ -192,6 +204,8 @@ class TransactionsWorkWithTestScenariosTestCaseAndSomeScenarios(TransactionTestC
* test scenarios test case (with transaction support)
* two dummy scenarios so that multiple test cases get generated
"""
+ def __hash__(self):
+ return hash(repr(self))
class TestReorderingNotBroken(DjangoTestCase):
@@ -203,23 +217,31 @@ class TestReorderingNotBroken(DjangoTestCase):
class Plain(TestCase):
"""" Empty test class inheriting from TestCase """
+ def __hash__(self):
+ return hash(repr(self))
def runTest(self, result):
pass
class PlainScenarios(TestCaseWithScenarios):
+ def __hash__(self):
+ return hash(repr(self))
def runTest(self, result):
pass
class Transaction(TransactionTestCase):
"""" Empty test class inheriting from TransactionTestCase """
+ def __hash__(self):
+ return hash(repr(self))
def runTest(self, result):
pass
class TransactionScenarios(TransactionTestCaseWithScenarios):
"""" Empty test class inheriting from TransactionTestCase """
+ def __hash__(self):
+ return hash(repr(self))
def runTest(self, result):
pass
@@ -236,7 +258,7 @@ class TestReorderingNotBroken(DjangoTestCase):
for cls in initial_order:
suite.addTest(cls())
reordered_suite = reorder_suite(suite, (DjangoTestCase,))
- self.assertEqual(map(type, reordered_suite._tests), proper_order)
+ self.assertEqual(list(map(type, reordered_suite._tests)), proper_order)
def test_transaction_test_case_stays_last(self):
self.ensure_proper_order(