Skip to content

Commit 03a7b39

Browse files
author
beyondgeeks
committed
test_initial_south_migrations: doc, fix
1 parent 54cdf06 commit 03a7b39

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/test_db_setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ def test_inner_south():
297297
}
298298
""")
299299
def test_initial_south_migrations(self, django_testdir_initial):
300+
"""
301+
Test initial data with existing South migrations.
302+
"""
300303
testdir = django_testdir_initial
301304
testdir.create_test_module('''
302305
import pytest
@@ -306,15 +309,10 @@ def test_inner_south():
306309
pass
307310
''')
308311

309-
testdir.mkpydir('tpkg/app/south_migrations')
310-
testdir.create_app_file("""
311-
from south.v2 import SchemaMigration
312+
testdir.create_initial_south_migration()
312313

313-
class Migration(SchemaMigration):
314-
def forwards(self, orm):
315-
print("mark_south_migration_forwards")
316-
""", 'south_migrations/0001_initial.py')
317314
result = testdir.runpytest('--tb=short', '-v', '-s')
315+
result.stdout.fnmatch_lines(['*test_inner_south*PASSED*'])
318316
result.stdout.fnmatch_lines(['*mark_south_migration_forwards*'])
319317

320318
@pytest.mark.django_project(extra_settings="""
@@ -340,7 +338,7 @@ def test_inner_south():
340338
p.write('raise Exception("This should not get imported.")',
341339
ensure=True)
342340

343-
result = testdir.runpytest('--tb=short', '-v')
341+
result = testdir.runpytest('--tb=short', '-v', '-s')
344342
result.stdout.fnmatch_lines(['*test_inner_south*PASSED*'])
345343

346344

0 commit comments

Comments
 (0)