Last active
April 10, 2021 20:35
-
-
Save kunal5/73c687bab0ed64a2a6f1ce4c25002e73 to your computer and use it in GitHub Desktop.
using transaction test cases without flush
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test.testcases import TransactionTestCase | |
from rest_framework.test import APITransactionTestCase | |
class TransactionTestCaseWithoutFlush(TransactionTestCase): | |
def _fixture_teardown(self): | |
""" | |
Prevents TransactionTestCase from calling the flush command. 'flush' calls TRUNCATE on postgres and it's | |
awfully slow. Use at your own risk | |
:return: | |
""" | |
pass | |
class APITransactionTestCaseWithoutFlush(APITransactionTestCase): | |
def _fixture_teardown(self): | |
""" | |
Prevents TransactionTestCase from calling the flush command. 'flush' calls TRUNCATE on postgres and it's | |
awfully slow. Use at your own risk | |
:return: | |
""" | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment