Skip to content

Commit f98e99e

Browse files
committed
Change "native migrations" to just "migrations"
These days just "migrations" is understood to be the built-in Django migrations.
1 parent d2beb3f commit f98e99e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pytest_django/fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def django_db_setup(
111111
setup_databases_args = {}
112112

113113
if not django_db_use_migrations:
114-
_disable_native_migrations()
114+
_disable_migrations()
115115

116116
if django_db_keepdb and not django_db_createdb:
117117
setup_databases_args["keepdb"] = True
@@ -186,7 +186,7 @@ class PytestDjangoTestCase(test_case_class): # type: ignore[misc,valid-type]
186186
request.addfinalizer(test_case._post_teardown)
187187

188188

189-
def _disable_native_migrations() -> None:
189+
def _disable_migrations() -> None:
190190
from django.conf import settings
191191
from django.core.management.commands import migrate
192192

tests/test_db_setup.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ def test_a():
449449
result.stdout.fnmatch_lines(["*PASSED*test_a*"])
450450

451451

452-
class TestNativeMigrations:
453-
""" Tests for Django Migrations """
452+
class TestMigrations:
453+
"""Tests for Django Migrations."""
454454

455455
def test_no_migrations(self, django_testdir) -> None:
456456
django_testdir.create_test_module(
@@ -464,12 +464,11 @@ def test_inner_migrations():
464464
"""
465465
)
466466

467-
migration_file = django_testdir.project_root.join(
468-
"tpkg/app/migrations/0001_initial.py"
469-
)
470-
assert migration_file.isfile()
471-
migration_file.write(
472-
'raise Exception("This should not get imported.")', ensure=True
467+
django_testdir.create_test_module(
468+
"""
469+
raise Exception("This should not get imported.")
470+
""",
471+
"migrations/0001_initial.py",
473472
)
474473

475474
result = django_testdir.runpytest_subprocess(

0 commit comments

Comments
 (0)