handle django3.2 using fancy quotes; enable devhub job for 3.2 (#16469)
* handle django3.2 using fancy quotes; enable devhub job for 3.2 * directly test django version for fancy quotes
This commit is contained in:
Родитель
bbdac0fefc
Коммит
ac82909f8d
|
@ -674,7 +674,7 @@ workflows:
|
|||
parameters:
|
||||
djangoversion:
|
||||
- django22
|
||||
# - django32 # django3.2 tests still failing
|
||||
- django32
|
||||
- docs
|
||||
- main:
|
||||
matrix:
|
||||
|
|
|
@ -9,6 +9,7 @@ import zipfile
|
|||
from datetime import datetime, timedelta
|
||||
from urllib.parse import urlencode
|
||||
|
||||
import django
|
||||
from django.conf import settings
|
||||
from django.core.files import temp
|
||||
from django.core.files.storage import default_storage as storage
|
||||
|
@ -43,6 +44,12 @@ from olympia.versions.models import License, VersionPreview
|
|||
from olympia.zadmin.models import Config, set_config
|
||||
|
||||
|
||||
IS_DJANGO_32 = django.VERSION[0] == 3
|
||||
# django3.2 uses fancy double quotes in its error strings
|
||||
STRING_QUOTE_OPEN = '“' if IS_DJANGO_32 else "'"
|
||||
STRING_QUOTE_CLOSE = '”' if IS_DJANGO_32 else "'"
|
||||
|
||||
|
||||
def get_addon_count(name):
|
||||
"""Return the number of addons with the given name."""
|
||||
return Addon.unfiltered.filter(name__localized_string=name).count()
|
||||
|
@ -1034,8 +1041,8 @@ class DetailsPageMixin(object):
|
|||
response,
|
||||
'form',
|
||||
'slug',
|
||||
"Enter a valid 'slug'" + ' consisting of letters, numbers, underscores or '
|
||||
'hyphens.',
|
||||
f'Enter a valid {STRING_QUOTE_OPEN}slug{STRING_QUOTE_CLOSE} consisting of '
|
||||
'letters, numbers, underscores or hyphens.',
|
||||
)
|
||||
|
||||
def test_submit_slug_required(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче