Skip to content

Commit cf75321

Browse files
committed
tests: clarify/expect failure with test_initial_south_migrations
1 parent 4cad31f commit cf75321

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/test_db_setup.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,8 @@ def test_inner_south():
311311
}
312312
""")
313313
def test_initial_south_migrations(self, django_testdir_initial):
314-
"""
315-
Test initial data with existing South migrations.
316-
"""
314+
"""This should fail, because it has no real migration that
315+
would create the table, and so no initial data can be loaded."""
317316
testdir = django_testdir_initial
318317
testdir.create_test_module('''
319318
import pytest
@@ -326,12 +325,9 @@ def test_inner_south():
326325
testdir.create_initial_south_migration()
327326

328327
result = testdir.runpytest('--tb=short', '-v', '-s')
329-
assert result.ret == 0
330-
result.stdout.fnmatch_lines_random([
331-
"tpkg/test_the_test.py::test_inner_south*",
332-
"*mark_south_migration_forwards*",
333-
"*PASSED*",
334-
"*Destroying test database for alias 'default'...*"])
328+
assert result.ret != 0
329+
result.stderr.fnmatch_lines(['*no such table: app_item*'])
330+
result.stdout.fnmatch_lines(['*mark_south_migration_forwards*'])
335331

336332
@pytest.mark.django_project(extra_settings="""
337333
INSTALLED_APPS += [ 'south', ]

0 commit comments

Comments
 (0)