Code

Opened 4 years ago

Closed 2 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.

Attachments (0)

Change History (7)

comment:1 Changed 4 years ago by bjunix

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 4 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

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 4 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 3 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.flatpages

comment:5 Changed 3 years ago by lukeplant

  • Type set to Cleanup/optimization

comment:6 Changed 3 years ago by lukeplant

  • Severity set to Normal

comment:7 Changed 2 years ago by claudep

  • Easy pickings unset
  • Resolution set to fixed
  • Status changed from new to closed
  • 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'...

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.