Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20048 closed Bug (fixed)

Test failures in flatpages app when custom User model is in use

Reported by: russellm Owned by: matiasb
Component: contrib.flatpages Version: 1.5
Severity: Release blocker 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

contrib.flatpages contains a number of tests that depend upon authenticated users. However, these tests fail if your app uses a custom User model.

These tests should be skipped if a custom User is defined.

An audit of other contrib apps should be performed for similar failures.

Change History (8)

comment:1 Changed 2 years ago by matiasb

  • Owner changed from nobody to matiasb
  • Status changed from new to assigned

comment:2 Changed 2 years ago by matiasb

Proposed pull request: https://github.com/django/django/pull/908.
Tests passing with SQLite.

Reviewing the other contrib apps, got failures for contrib.sitemaps, created #20060.

comment:3 Changed 2 years ago by matiasb

  • Has patch set

comment:4 Changed 2 years ago by bmispelon

Shouldn't the fixes in tests/forms.py (https://github.com/django/django/pull/908/files#diff-1) be part of a different ticket?

comment:5 Changed 2 years ago by matiasb

If that's preferred, sure. Worked this out here because there wasn't a ticket for that other test and I was fixing tests for flatpages.
Just let me know and I can add a ticket and rework the pull request.

comment:6 Changed 2 years ago by aaugustin

  • Triage Stage changed from Accepted to Ready for checkin

I'm fine with the scope of this PR, and it looks good to me.

comment:7 Changed 2 years ago by Russell Keith-Magee <russell@…>

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

In d35e621633640797d2db15ec2ff05ff97a3b80a6:

[1.5.x] Fixed #20048, #20060 -- Modified tests for contrib apps sensitive to custom User models.

Thanks to matiasb for the report of #20060 and the draft patch for #20048.

(cherry picked from commit 930af661abdb4eb7322f1ab06f21df9ed04af43d)

comment:8 Changed 2 years ago by Russell Keith-Magee <russell@…>

In 930af661abdb4eb7322f1ab06f21df9ed04af43d:

Fixed #20048, #20060 -- Modified tests for contrib apps sensitive to custom User models.

Thanks to matiasb for the report of #20060 and the draft patch for #20048.

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