Reverted a change to UserFactory to avoid nepalese names. The issue is bigger, and needs a different resulution. Changed the url pattern that used \w to match names to instead use a more inclusive regex.

- Legacy-Id: 15088
This commit is contained in:
Henrik Levkowetz 2018-04-26 11:53:51 +00:00
parent fec59ad937
commit c7350be50f
2 changed files with 2 additions and 6 deletions

View file

@ -47,7 +47,7 @@ urlpatterns = [
url(r'^$', views_search.search),
url(r'^search/?$', views_search.search),
url(r'^in-last-call/?$', views_search.drafts_in_last_call),
url(r'^ad/(?P<name>[\w.-]+)/$(?u)', views_search.docs_for_ad),
url(r'^ad/(?P<name>[^/]+)/?$(?u)', views_search.docs_for_ad),
url(r'^ad2/(?P<name>[\w.-]+)/$(?u)', RedirectView.as_view(url='/doc/ad/%(name)s/', permanent=True)),
url(r'^rfc-status-changes/?$', views_status_change.rfc_status_changes),
url(r'^start-rfc-status-change/(?:%(name)s/)?$' % settings.URL_REGEXPS, views_status_change.start_rfc_status_change),

View file

@ -24,11 +24,7 @@ def random_faker():
# extraction code, and also don't seem to match the way people with arabic
# names romanize arabic names. Exlude those locales from name generation
# in order to avoid test failures.
# 25 Apr 2018: Also exclude nepalese. Nepalese names can contain
# non-spacing marks, which don't match \w; thus there are names that
# won't match ^\w+$, which is problematic in some url patterns meant to
# match names.
locales = set( [ l for l in faker.config.AVAILABLE_LOCALES if not (l.startswith('ar_') or l.startswith('sg_') or l.startswith('ne_')) ] )
locales = set( [ l for l in faker.config.AVAILABLE_LOCALES if not (l.startswith('ar_') or l.startswith('sg_')) ] )
return faker.Faker(random.sample(locales, 1)[0])
class UserFactory(factory.DjangoModelFactory):