View tests should probably not use Zopeless layers

Bug #781014 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

Several view tests in lp.registry.browser.tests.test_distroseries use
LaunchpadZopelessLayer. This seems to be the wrong thing to do because
PermissiveSecurityPolicy is used in these layers.

I think this situation has arisen because layers are confusing. It's
difficult to know what you're getting without reading a lot of
code. When choosing layers I have often taken an approach like "find
the layer with the shortest name that lets my tests pass", and I know
I'm not the only one! We need to make layers more understandable,
perhaps through more documentation (though I groan at that thought),
or by replacing layers with a more transparent system.

*ZopelessLayer also appears in these other browser tests:

lib/lp/registry/browser/tests/test_person_view.py
lib/lp/registry/browser/tests/test_distroseries.py
lib/lp/translations/browser/tests/test_translationgroup.py
lib/lp/translations/browser/tests/test_product_view.py
lib/lp/translations/browser/tests/test_translatablemessage_view.py
lib/lp/translations/browser/tests/test_translationlinksaggregator.py
lib/lp/translations/browser/tests/test_persontranslationview.py
lib/lp/translations/browser/tests/test_distroserieslanguage_views.py

(find lib/lp/*/browser/tests -name '*.py' -print0 |
   xargs -r0 fgrep ZopelessLayer -l)

Tags: tech-debt
Changed in launchpad:
importance: High → Low
tags: added: tech-debt
tags: removed: derivation
Changed in launchpad:
importance: Low → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.