@@ -246,7 +246,7 @@ def test_inner_south():
246
246
@pytest .mark .skipif (sys .version_info [0 ] == 3 ,
247
247
reason = 'South is not properly supported on Python 3' )
248
248
class TestSouth :
249
- """Test interaction with initial_data and South ."""
249
+ """Test interaction with South, with and without initial_data ."""
250
250
251
251
@pytest .mark .django_project (extra_settings = """
252
252
INSTALLED_APPS += [ 'south', ]
@@ -329,6 +329,36 @@ def test_inner_south():
329
329
result .stderr .fnmatch_lines (['*no such table: app_item*' ])
330
330
result .stdout .fnmatch_lines (['*mark_south_migration_forwards*' ])
331
331
332
+ @pytest .mark .django_project (extra_settings = """
333
+ INSTALLED_APPS += [ 'south', ]
334
+ SOUTH_TESTS_MIGRATE = True
335
+ SOUTH_MIGRATION_MODULES = {
336
+ 'app': 'tpkg.app.south_migrations',
337
+ }
338
+ """ )
339
+ def test_south_migrations (self , django_testdir ):
340
+ """South migration with a normal testdir (no initial data)."""
341
+ testdir = django_testdir
342
+ testdir .create_test_module ('''
343
+ import pytest
344
+
345
+ @pytest.mark.django_db
346
+ def test_inner_south():
347
+ pass
348
+ ''' )
349
+
350
+ testdir .mkpydir ('tpkg/app/south_migrations' )
351
+ testdir .create_app_file ("""
352
+ from south.v2 import SchemaMigration
353
+
354
+ class Migration(SchemaMigration):
355
+ def forwards(self, orm):
356
+ print("mark_south_migration_forwards")
357
+ """ , 'south_migrations/0001_initial.py' )
358
+ result = testdir .runpytest ('--tb=short' , '-v' , '-s' )
359
+ assert result .ret == 0
360
+ result .stdout .fnmatch_lines (['*mark_south_migration_forwards*' ])
361
+
332
362
@pytest .mark .django_project (extra_settings = """
333
363
INSTALLED_APPS += [ 'south', ]
334
364
SOUTH_TESTS_MIGRATE = False
0 commit comments