Opened 14 years ago

Closed 12 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

Description

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

Change History (7)

comment:1 by bjunix, 14 years ago

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.

[1] http://groups.google.com/group/django-users/browse_thread/thread/157afb4fbf668f18

comment:2 by Russell Keith-Magee, 14 years ago

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 by faldridge, 14 years ago

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 by Gabriel Hurley, 13 years ago

Component: Contrib appscontrib.flatpages

comment:5 by Luke Plant, 13 years ago

Type: Cleanup/optimization

comment:6 by Luke Plant, 13 years ago

Severity: Normal

comment:7 by Claude Paroz, 12 years ago

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

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

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

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