~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/answers/doc/faq.txt

  • Committer: Curtis Hovey
  • Date: 2011-12-24 17:49:30 UTC
  • mto: This revision was merged to the branch mainline in revision 14602.
  • Revision ID: curtis.hovey@canonical.com-20111224174930-xk1d5cvhyxq46ctf
Moved webapp to lp.services.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
provided by objects that can host FAQs.
12
12
 
13
13
    >>> from zope.security.proxy import removeSecurityProxy
14
 
    >>> from canonical.launchpad.webapp.testing import verifyObject
 
14
    >>> from lp.services.webapp.testing import verifyObject
15
15
 
16
16
    >>> from lp.answers.interfaces.faqtarget import IFAQTarget
17
17
    >>> from lp.registry.interfaces.distribution import IDistributionSet
35
35
 
36
36
    >>> login('test@canonical.com')
37
37
 
38
 
    >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
 
38
    >>> from lp.services.webapp.interfaces import ILaunchBag
39
39
    >>> sample_person = getUtility(ILaunchBag).user
40
40
    >>> print firefox.owner.displayname
41
41
    Sample Person
175
175
 
176
176
Only the project owners or answer contacts can edit an IFAQ.
177
177
 
178
 
    >>> from canonical.launchpad.webapp.authorization import check_permission
 
178
    >>> from lp.services.webapp.authorization import check_permission
179
179
 
180
180
    >>> login(ANONYMOUS)
181
181
    >>> check_permission('launchpad.Edit', firefox_faq)
200
200
    >>> firefox.addAnswerContact(no_priv, no_priv)
201
201
    True
202
202
 
203
 
    >>> from canonical.launchpad.webapp.authorization import clear_cache
 
203
    >>> from lp.services.webapp.authorization import clear_cache
204
204
    >>> clear_cache()
205
205
    >>> check_permission('launchpad.Edit', firefox_faq)
206
206
    True