Skip to content

Tests fail to run under some conditions (?) #922

Description

@sephii

Issue summary

There’s a single failure in the tests when I run them locally:

======================================================================
ERROR: test_edit_nested_snippet_translation (wagtail_localize.tests.test_edit_translation.TestGetEditTranslationView.test_edit_nested_snippet_translation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/nix/store/llkagd3zdsc5yzyvnrqf6iisnfwadwdc-python3.12-django-5.2.13/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/llkagd3zdsc5yzyvnrqf6iisnfwadwdc-python3.12-django-5.2.13/lib/python3.12/site-packages/django/db/backends/sqlite3/base.py", line 360, in execute
    return super().execute(query, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: UNIQUE constraint failed: wagtail_localize_test_subnavigationlink.translation_key, wagtail_localize_test_subnavigationlink.locale_id

The problem occurs with Wagtail 7.4, 7.3 and 7.2. I couldn’t figure out what causes it to fail.

Also Wagtail 7.3 is not covered by the Tox matrix.

Steps to reproduce

  1. Run python testmanage.py test locally

Additional information

No response

Can be reproduced

Not confirmed

Technical details

  • Python version: 3.12
  • Django version: 5.2.13
  • Wagtail version: 7.4

Python environment:

anyascii==0.3.3
asgiref==3.11.0
beautifulsoup4==4.14.3
certifi==2026.1.4
charset-normalizer==3.4.4
click==8.3.1
croniter==6.0.0
defusedxml==0.8.0rc2
dj-database-url==0.0.0
Django==5.2.13
django-filter==25.2
django-modelcluster==6.5
django-permissionedforms==0.1
django-rq==4.1.0
django-stubs-ext==5.2.9
django-taggit==6.1.0
django-tasks==0.12.0
django-treebeard==4.8.0
djangorestframework==3.16.1
draftjs_exporter==5.1.0
et_xmlfile==2.0.0
filetype==1.2.0
freezegun==1.5.5
google==3.0.0
idna==3.11
laces==0.1.2
modelsearch==1.3.1
openpyxl==3.1.5
pillow==12.2.0
pillow_heif==1.3.0
polib==1.2.0
python-dateutil==2.9.0.post0
pytz==2026.1.post1
redis==7.4.0
requests==2.33.1
rq==2.8.0
setuptools==80.10.1
six==1.17.0
soupsieve==2.8.3
sqlparse==0.5.5
telepath==0.3.1
typing_extensions==4.15.0
urllib3==2.6.3
wagtail==7.4
wagtail-modeladmin==2.3.0
Willow==1.12.0

Working on this

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions