Loading tests/migrations/test_base.py +6 −0 Original line number Diff line number Diff line import os from django.db import connection from django.db.migrations.recorder import MigrationRecorder from django.test import TransactionTestCase from django.utils._os import upath Loading @@ -13,6 +14,11 @@ class MigrationTestBase(TransactionTestCase): available_apps = ["migrations"] test_dir = os.path.abspath(os.path.dirname(upath(__file__))) def tearDown(self): # Reset applied-migrations state. recorder = MigrationRecorder(connection) recorder.migration_qs.filter(app='migrations').delete() def get_table_description(self, table): with connection.cursor() as cursor: return connection.introspection.get_table_description(cursor, table) Loading Loading
tests/migrations/test_base.py +6 −0 Original line number Diff line number Diff line import os from django.db import connection from django.db.migrations.recorder import MigrationRecorder from django.test import TransactionTestCase from django.utils._os import upath Loading @@ -13,6 +14,11 @@ class MigrationTestBase(TransactionTestCase): available_apps = ["migrations"] test_dir = os.path.abspath(os.path.dirname(upath(__file__))) def tearDown(self): # Reset applied-migrations state. recorder = MigrationRecorder(connection) recorder.migration_qs.filter(app='migrations').delete() def get_table_description(self, table): with connection.cursor() as cursor: return connection.introspection.get_table_description(cursor, table) Loading