diff options
author | Rémi Duraffort <remi.duraffort@linaro.org> | 2016-08-09 15:57:09 +0200 |
---|---|---|
committer | Rémi Duraffort <remi.duraffort@linaro.org> | 2016-08-09 15:57:09 +0200 |
commit | d368a96a9276f49f15d0aa6daa60fc87ddcd5a6f (patch) | |
tree | 83f4e78960951b4671a639fa7e5b560a67bd11e8 | |
parent | 1d77ec1c409d6723ed6b35a0a9f104176d033e67 (diff) |
Port to python3
Change-Id: I8f148b619870f9b057e24febef92fb217a1a97f7
-rw-r--r-- | django_testscenarios/tests.py | 24 |
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( |