Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20117 closed Bug (fixed)

Flatpages test failure in a project with language different to 'en'

Reported by: matiasb Owned by: matiasb
Component: contrib.flatpages Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Having a project with contrib.flatpages in INSTALLED_APPS and a LANGUAGE_CODE setting different to 'en' (for example, LANGUAGE_CODE = 'fr-fr'), running flatpages tests I'm getting a failing test:

$ ./manage.py test flatpages
Creating test database for alias 'default'...
.F...............................................
======================================================================
FAIL: test_flatpage_admin_form_url_uniqueness_validation (django.contrib.flatpages.tests.forms.FlatpageAdminFormTests)
The flatpage admin form correctly enforces url uniqueness among flatpages of the same site
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matiasb/projects/django/dev/django/django/contrib/flatpages/tests/forms.py", line 65, in test_flatpage_admin_form_url_uniqueness_validation
    {'__all__': ['Flatpage with url /myflatpage1/ already exists for site example.com']})
AssertionError: {u'__all__': [u"La page statique \xe0 l'URL /myflatpage1/ existe d\xe9j\xe0 pour le site example.com"]} != {u'__all__': [u'Flatpage with url /myflatpage1/ already exists for site example.com']}

----------------------------------------------------------------------
Ran 49 tests in 4.370s

FAILED (failures=1)

Change History (5)

comment:1 Changed 2 years ago by matiasb

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned

Created pull request fixing the test: https://github.com/django/django/pull/946
Tests passing with SQLite.

comment:2 Changed 2 years ago by grampajoe

  • Easy pickings set
  • Triage Stage changed from Unreviewed to Accepted

Confirmed the failure, and confirmed tests pass with the patch.

comment:3 Changed 2 years ago by grampajoe

  • Triage Stage changed from Accepted to Ready for checkin

Moving to RFC. It's a really small fix, and I don't think there's anything left to be done.

comment:4 Changed 2 years ago by matiasb <mbordese@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 6985f0c09bdf87509a1ca3c98f7ba45a7a9dbc0c:

Fixed #20117 -- Added missing translation override to fix flatpages test.

comment:5 Changed 2 years ago by Simon Charette <charette.s@…>

In 151938ddb5f9537c80c1a6426f2c6ce14adc92d9:

Merge pull request #946 from matiasb/minor-flatpage-translation-fix

Fixed #20117 -- Added missing translation override to fix flatpages test.

Note: See TracTickets for help on using tickets.
Back to Top