#24812 closed Bug (fixed)
RuntimeWarning in schema tests about reloading models
Reported by: | Tim Graham | Owned by: | Tim Graham |
---|---|---|---|
Component: | Migrations | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Warning should be fixed or silenced.
$ python -Wall runtests.py schema /home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ./home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ..../home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localauthorwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) .sss/home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localauthorwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ./home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ./home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) /home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_uniques.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ./home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_tags.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class) /home/tim/code/django/django/db/models/base.py:279: RuntimeWarning: Model 'localbookwithm2m_uniques.schema' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
There is also one warning on the stable/1.7.x branch.
Also:
$ python -Wall runtests.py migrations.test_state /home/tim/code/django/tests/migrations/test_state.py:450: RuntimeWarning: Model 'a.something' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. class A(models.Model): /home/tim/code/django/tests/migrations/test_state.py:454: RuntimeWarning: Model 'b.something' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. class B(models.Model): ....../home/tim/code/django/tests/migrations/test_state.py:497: RuntimeWarning: Model 'a.something' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models. class A(models.Model):
Change History (6)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Patch looks sensible to me, given the tests pass and the runtime warning(s) is/are gone.
Note:
See TracTickets
for help on using tickets.
PR