﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21148	Test isolation errors on master.	Florian Apolloner	nobody	"```
./runtests.py select_for_update swappable_models --settings=test_sqlite
Creating test database for alias 'default'...
Creating test database for alias 'other'...
.Essssssss
======================================================================
ERROR: test_generated_data (swappable_models.tests.SwappableModelTests)
Permissions and content types are not created for a swapped model
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/home/florian/sources/django.git/django/test/utils.py"", line 220, in inner
    return test_func(*args, **kwargs)
  File ""/home/florian/sources/django.git/tests/swappable_models/tests.py"", line 39, in test_generated_data
    ContentType.objects.filter(app_label='swappable_models').delete()
  File ""/home/florian/sources/django.git/django/db/models/query.py"", line 558, in delete
    collector.delete()
  File ""/home/florian/sources/django.git/django/db/models/deletion.py"", line 262, in delete
    qs._raw_delete(using=self.using)
  File ""/home/florian/sources/django.git/django/db/models/query.py"", line 570, in _raw_delete
    sql.DeleteQuery(self.model).delete_qs(self, using)
  File ""/home/florian/sources/django.git/django/db/models/sql/subqueries.py"", line 86, in delete_qs
    self.get_compiler(using).execute_sql(None)
  File ""/home/florian/sources/django.git/django/db/models/sql/compiler.py"", line 763, in execute_sql
    cursor.execute(sql, params)
  File ""/home/florian/sources/django.git/django/db/utils.py"", line 101, in inner
    return func(*args, **kwargs)
  File ""/home/florian/sources/django.git/django/db/utils.py"", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File ""/home/florian/sources/django.git/django/db/utils.py"", line 101, in inner
    return func(*args, **kwargs)
  File ""/home/florian/sources/django.git/django/db/backends/sqlite3/base.py"", line 476, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such table: multiple_database_review

----------------------------------------------------------------------
Ran 10 tests in 0.046s

FAILED (errors=1, skipped=8)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
```

This is caused by #15903 -- I don't see an obvious fix though, some stuff requires all models to be registered (tests come to mind where you change INSTALLED_APPS on demand, but the related cache is only filled once) while other stuff (like the collector) should never see models from not installed applications."	Bug	new	Database layer (models, ORM)	dev	Normal		app-refactor, app, refactor		Accepted	0	0	0	0	0	0
