Opened 11 years ago
Last modified 10 years ago
#21148 closed Bug
Test isolation errors on master. — at Version 1
Reported by: | Florian Apolloner | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | app-refactor, app, refactor |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
./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.
Note:
See TracTickets
for help on using tickets.