'For an app without migrations, editor.execute() is used for executing
the syncdb deferred SQL.'

@override_settings(INSTALLED_APPS=['migrations.migrations_test_apps.unmigrated_app_syncdb'])
def test_migrate_syncdb_deferred_sql_executed_with_schemaeditor(self):

    with mock.patch.object(BaseDatabaseSchemaEditor, 'execute') as execute:
        call_command('migrate', run_syncdb=True, verbosity=0)
        create_table_count = len([call for call in execute.mock_calls if ('CREATE    TABLE' in str(call))])
        self.assertEqual(create_table_count, 2)
        self.assertGreater(len(execute.mock_calls), 2)
