@pytest.fixture
def django_testdir_initial(django_testdir):
    django_testdir.makefile('.json', initial_data="""
        [{
            "pk": 1,
            "model": "app.item",
            "fields": { "name": "mark_initial_data" }
        }]""")

    def _create_initial_south_migration():
        """
        Create initial South migration for pytest_django_test/app/models.py.
        """
        django_testdir.mkpydir('tpkg/app/south_migrations')
        django_testdir.create_app_file("""
            from south.v2 import SchemaMigration
            from south.db import db

            class Migration(SchemaMigration):
                def forwards(self, orm):
                    db.create_table(u'app_item', (
                        (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
                        ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
                    ))
                    db.send_create_signal(u'app', ['Item'])
                    print("mark_south_migration_forwards"),

                def backwards(self, orm):
                    db.delete_table(u'app_item')

                models = {
                    u'app.item': {
                        'Meta': {'object_name': 'Item'},
                        u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
                        'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
                    }
                }

                complete_apps = ['app']
            """, 'south_migrations/0001_initial.py')
    django_testdir.create_initial_south_migration = _create_initial_south_migration

    return django_testdir
A django_testdir fixture which provides initial_data.
dataset/ETHPy150Open pytest-dev/pytest-django/tests/conftest.py/django_testdir_initial