Merge lp:~danilo/maas/django-upgrade-legacy-migrations into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Данило Шеган |
Approved revision: | no longer in the source branch. |
Merged at revision: | 6098 |
Proposed branch: | lp:~danilo/maas/django-upgrade-legacy-migrations |
Merge into: | lp:~maas-committers/maas/trunk |
Prerequisite: | lp:~danilo/maas/django-upgrade-method-fixes |
Diff against target: |
373 lines (+95/-97) 8 files modified
src/maasserver/djangosettings/development.py (+10/-1) src/maasserver/fields.py (+0/-17) src/maasserver/middleware.py (+54/-12) src/maasserver/tests/__init__.py (+9/-1) src/maasserver/tests/test_fields.py (+0/-7) src/maasserver/tests/test_middleware.py (+6/-6) src/maastesting/djangotestcase.py (+2/-53) src/metadataserver/tests/__init__.py (+14/-0) |
To merge this branch: | bzr merge lp:~danilo/maas/django-upgrade-legacy-migrations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mike Pontillo (community) | Approve | ||
Review via email: mp+325898@code.launchpad.net |
Commit message
1. Remove legacy region test setup and instead make it part of the development settings to avoid problems due to differences in import order between Django 1.8 and 1.11.
2. Replace use of build_request_repr for the DebuggingLogger
3. Stop restricting lookup types for JSONField and XMLField fields because this was of limited use and entirely changed in 1.10.
Description of the change
We also stop restricting lookup types for JSONField and XMLField fields: get_prep_lookup and get_db_prep_lookup methods are gone in 1.10, and lookups are defined in a different way since, and it's not worth it to override all existing built-in lookups for these two fields and catching weird comparisons like >= on JSON fields.
Most of the legacy test setup is now simplified, though there's still cleanup rogue DB connections that fails in 1.8 but now again works in 1.11 that we may want to re-enable.
I'm confused about how appending to INSTALLED_APPS is going to work. I see the following code in the file, when I look at the full diff context:
# We expect the following settings to be overridden. They are mentioned here
# to silence lint warnings.
INSTALLED_APPS = None
# Extend base settings. settings( settings)
import_
prevent_ migrations = StringBool( ).to_python( environ. get("MAAS_ PREVENT_ MIGRATIONS" , 0))
os.
if prevent_migrations:
INSTALLED_ APPS += ("maasserver. tests", "metadataserver .tests" )
So how is a tuple going to be appended to None?