Opened 9 years ago

Closed 7 years ago

#13219 closed Cleanup/optimization (fixed)

contrib.flatpages needs tests

Reported by: bjunix Owned by: nobody
Component: contrib.flatpages Version: 1.1
Severity: Normal Keywords: flatpages, tests
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There aren't any tests for the contrib.flatpages app.

Change History (7)

comment:1 Changed 9 years ago by bjunix

Flatpages is a rather minimal app so I guess only few tests need to get written.

On django-users[1] Russel stated there are a couple of edge cases to be considered. I can't think of any straight away, but they could get summed up here.


comment:2 Changed 9 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

Some elaboration for the benefit of anyone interested in pursuing this:

  • There is both the flatpages view and the flatpages middleware to consider
  • Most of the edge cases revolve around the first few lines of the flatpages view, where ambiguities in trailing and leading slashes are resolved. Historically, this has been the cause of a couple of bug reports.

All that is really needed is path coverage of the view and middleware.

comment:3 Changed 9 years ago by faldridge

Hi, bjunix. It seems there is some overlap here with ticket #6932. In #6932, Mnewman added a new template tag to the flatpages app with unit tests.

In the course of working on that ticket, he noticed the lack of tests for the flatpages app in general and already started filling in the gaps.

It would probably be most convenient to start from there, and just added tests for trailing and leading slashes to the existing test suite.

comment:4 Changed 8 years ago by Gabriel Hurley

Component: Contrib appscontrib.flatpages

comment:5 Changed 8 years ago by Luke Plant

Type: Cleanup/optimization

comment:6 Changed 8 years ago by Luke Plant

Severity: Normal

comment:7 Changed 7 years ago by Claude Paroz

Easy pickings: unset
Resolution: fixed
Status: newclosed
UI/UX: unset

I don't think this is true any more today.

PYTHONPATH=.. ./ --settings=test_sqlite flatpages
Creating test database for alias 'default'...
Creating test database for alias 'other'...
Ran 43 tests in 0.776s

Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
Note: See TracTickets for help on using tickets.
Back to Top