~launchpad-pqm/launchpad/devel

10724.1.1 by Henning Eggers
First batch of Project -> ProjectGrpoup renamings.
1
====================================
2
ProjectGroups and the answer tracker
3
====================================
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
4
7675.535.1 by Henning Eggers
Merged stable, resolving conflicts.
5
Although question cannot be filed directly against project groups,
6
IProjectGroup in Launchpad also provides the IQuestionCollection and
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
7
ISearchableByQuestionOwner interfaces.
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
8
4682.1.6 by Christian Reis
Use webapp.testing's verifyObject in all doctests, which copes with security-proxied objects, and remove the crack I added to the bug and bugtask uses of it.
9
    >>> from canonical.launchpad.webapp.testing import verifyObject
10409.5.38 by Curtis Hovey
Removed glob imports for answers.
10
    >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
7675.518.5 by Barry Warsaw
Here comes another one.
11
    >>> from lp.answers.interfaces.questioncollection import (
12
    ...     ISearchableByQuestionOwner, IQuestionCollection)
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
13
10326.1.1 by Henning Eggers
Mechanically renamed IProject* to IProjectGroup*.
14
    >>> mozilla_project = getUtility(IProjectGroupSet).getByName('mozilla')
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
15
    >>> verifyObject(IQuestionCollection, mozilla_project)
16
    True
17
    >>> verifyObject(ISearchableByQuestionOwner, mozilla_project)
18
    True
19
7675.518.5 by Barry Warsaw
Here comes another one.
20
21
Questions filed against project in a project group
22
==================================================
23
24
You can search for all questions filed against projects in a project using the
25
project group's searchQuestions() method.
26
11716.1.12 by Curtis Hovey
Sorted imports in doctests.
27
    >>> from lp.registry.interfaces.person import IPersonSet
7675.518.5 by Barry Warsaw
Here comes another one.
28
    >>> from lp.registry.interfaces.product import IProductSet
29
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
30
    >>> login('test@canonical.com')
31
    >>> thunderbird = getUtility(IProductSet).getByName('thunderbird')
7675.518.5 by Barry Warsaw
Here comes another one.
32
    >>> sample_person = getUtility(IPersonSet).getByName('name12')
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
33
    >>> question = thunderbird.newQuestion(
7675.518.5 by Barry Warsaw
Here comes another one.
34
    ...     sample_person,
35
    ...     "SVG attachments aren't displayed ",
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
36
    ...     "It would be a nice feature if SVG attachments could be displayed"
7675.518.5 by Barry Warsaw
Here comes another one.
37
    ...     " inlined.")
3691.402.3 by Francis J. Lacoste
Made Project implement ITicketCollection.
38
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
39
    >>> for question in mozilla_project.searchQuestions(search_text='svg'):
40
    ...     print question.title, question.target.displayname
41
    SVG attachments aren't displayed            Mozilla Thunderbird
42
    Problem showing the SVG demo on W3C site    Mozilla Firefox
43
7675.518.5 by Barry Warsaw
Here comes another one.
44
In the case where a project group has no projects, there are no results.
4055.1.1 by Curtis Hovey
Fix #102357, TypeError when requesting +tickets on an empty project.
45
10326.1.1 by Henning Eggers
Mechanically renamed IProject* to IProjectGroup*.
46
    >>> aaa_project = getUtility(IProjectGroupSet).getByName('aaa')
7675.518.5 by Barry Warsaw
Here comes another one.
47
    >>> list(aaa_project.searchQuestions())
4055.1.1 by Curtis Hovey
Fix #102357, TypeError when requesting +tickets on an empty project.
48
    []
49
7675.518.5 by Barry Warsaw
Here comes another one.
50
Questions can be searched by all the standard searchQuestions() parameters.
51
See questiontarget.txt for the full details.
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
52
12915.5.1 by Curtis Hovey
Rename questionenums.py to the new standard or enums.py
53
    >>> from lp.answers.enums import (
7675.518.5 by Barry Warsaw
Here comes another one.
54
    ...     QuestionSort, QuestionStatus)
3691.398.23 by Francis J. Lacoste
Merge RF, resolving many conflicts.
55
    >>> for question in mozilla_project.searchQuestions(
56
    ...     owner=sample_person, status=QuestionStatus.OPEN,
57
    ...     sort=QuestionSort.OLDEST_FIRST):
58
    ...     print question.title, question.target.displayname
59
    Problem showing the SVG demo on W3C site    Mozilla Firefox
60
    SVG attachments aren't displayed            Mozilla Thunderbird
61
7675.518.5 by Barry Warsaw
Here comes another one.
62
63
Languages
64
=========
65
66
getQuestionLanguages() returns the set of languages that is used by all the
67
questions in the project group's projects.
68
69
    # The Firefox project group has one question created in Brazilian
11235.5.4 by Curtis Hovey
hush lint.
70
    # Portuguese.
7675.518.5 by Barry Warsaw
Here comes another one.
71
    >>> print ', '.join(
72
    ...     sorted(language.code
73
    ...            for language in mozilla_project.getQuestionLanguages()))
74
    en, pt_BR
75
76
In the case where a project group has no projects, there are no results.
77
78
    >>> list(aaa_project.getQuestionLanguages())
4055.1.1 by Curtis Hovey
Fix #102357, TypeError when requesting +tickets on an empty project.
79
    []