Skip to content

Commit dcb79b4

Browse files
author
beyondgeeks
committed
Add test_south_migrations_python_files_star
This is meant to reproduce/test pytest-dev/pytest-django#158, but does not cause a failure.
1 parent 03a7b39 commit dcb79b4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/test_db_setup.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,39 @@ def test_inner_south():
341341
result = testdir.runpytest('--tb=short', '-v', '-s')
342342
result.stdout.fnmatch_lines(['*test_inner_south*PASSED*'])
343343

344+
@pytest.mark.django_project(extra_settings="""
345+
INSTALLED_APPS += [ 'south', ]
346+
SOUTH_TESTS_MIGRATE = True
347+
SOUTH_MIGRATION_MODULES = {
348+
'app': 'tpkg.app.south_migrations',
349+
}
350+
""")
351+
def test_south_migrations_python_files_star(self, django_testdir_initial):
352+
"""
353+
Test for South migrations and tests imported via `*.py`.
354+
355+
This is meant to reproduce
356+
https://github.com/pytest-dev/pytest-django/issues/158, but does not
357+
fail.
358+
"""
359+
testdir = django_testdir_initial
360+
testdir.create_test_module('''
361+
import pytest
362+
363+
@pytest.mark.django_db
364+
def test_inner_south():
365+
pass
366+
''', 'test.py')
367+
testdir.create_initial_south_migration()
368+
369+
pytest_ini = testdir.create_test_module("""
370+
[pytest]
371+
python_files=*.py""", 'pytest.ini')
372+
373+
result = testdir.runpytest('--tb=short', '-v', '-s', '-c', pytest_ini)
374+
result.stdout.fnmatch_lines(['*test_inner_south*PASSED*'])
375+
result.stdout.fnmatch_lines(['*mark_south_migration_forwards*'])
376+
344377

345378
class TestNativeMigrations(object):
346379
""" Tests for Django 1.7 Migrations """

0 commit comments

Comments
 (0)