[PATCH 11/11] settings: Fix deprecated 'TEST_CHARSET' warning

Damien Lespiau damien.lespiau at intel.com
Wed Aug 19 23:58:02 AEST 2015


On Tue, Jun 30, 2015 at 09:52:09AM +0100, Stephen Finucane wrote:
> Resolve a 'RemovedInDjango19Warning' with the 'TEST_CHARSET' option.
> 
> In addition, move a setting from 'settings.base' into the correct
> location.

-> 2 patches! :) 

The documentation also mentions TEST_CHARSET.

-- 
Damien

> Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
> ---
>  patchwork/settings/base.py | 6 ++++--
>  patchwork/settings/dev.py  | 8 +++++++-
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
> index 5b40bcb..d00245d 100644
> --- a/patchwork/settings/base.py
> +++ b/patchwork/settings/base.py
> @@ -50,6 +50,10 @@ LANGUAGE_CODE = 'en-au'
>  
>  USE_I18N = True
>  
> +# Testing
> +
> +TEST_RUNNER = 'django.test.runner.DiscoverRunner'
> +
>  # URLs
>  
>  ROOT_URLCONF = 'patchwork.urls'
> @@ -113,5 +117,3 @@ COMPAT_REDIR = True
>  # the scheme based on current access. This is useful if SSL protocol
>  # is terminated upstream of the server (e.g. at the load balancer)
>  FORCE_HTTPS_LINKS = False
> -
> -TEST_RUNNER = 'django.test.runner.DiscoverRunner'
> diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
> index 3f2355d..e93249c 100644
> --- a/patchwork/settings/dev.py
> +++ b/patchwork/settings/dev.py
> @@ -38,10 +38,16 @@ DATABASES = {
>          'USER': os.environ['PW_TEST_DB_USER'],
>          'PASSWORD': os.environ['PW_TEST_DB_PASS'],
>          'NAME': 'patchwork',
> -        'TEST_CHARSET': 'utf8',
>      },
>  }
>  
> +if django.VERSION < (1, 7):
> +    DATABASES['default']['TEST_CHARSET'] = 'utf8'
> +else:
> +    DATABASES['default']['TEST'] = {
> +        'CHARSET': 'utf8',
> +    }
> +
>  #
>  # Patchwork settings
>  #
> -- 
> 2.0.0
> 
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list