Merge lp:~jcsackett/launchpad/deprecate-remaining-official-bools into lp:launchpad
- deprecate-remaining-official-bools
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11528 |
Proposed branch: | lp:~jcsackett/launchpad/deprecate-remaining-official-bools |
Merge into: | lp:launchpad |
Diff against target: |
632 lines (+121/-109) 19 files modified
lib/lp/answers/browser/questiontarget.py (+2/-1) lib/lp/answers/doc/question.txt (+5/-5) lib/lp/answers/doc/questionsets.txt (+8/-8) lib/lp/registry/browser/distribution.py (+2/-2) lib/lp/registry/browser/pillar.py (+21/-16) lib/lp/registry/browser/productseries.py (+1/-1) lib/lp/registry/browser/tests/distribution-views.txt (+3/-2) lib/lp/registry/browser/tests/pillar-views.txt (+20/-20) lib/lp/registry/browser/tests/product-views.txt (+3/-2) lib/lp/registry/browser/tests/productseries-views.txt (+7/-7) lib/lp/registry/browser/tests/projectgroup-views.txt (+4/-2) lib/lp/registry/doc/distribution.txt (+15/-14) lib/lp/registry/doc/product.txt (+14/-14) lib/lp/registry/templates/distribution-index.pt (+3/-3) lib/lp/registry/templates/distribution-search.pt (+2/-2) lib/lp/registry/templates/distroseries-index.pt (+2/-1) lib/lp/registry/templates/product-index.pt (+3/-3) lib/lp/registry/templates/productseries-index.pt (+1/-1) lib/lp/registry/templates/project-index.pt (+5/-5) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/deprecate-remaining-official-bools |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+34436@code.launchpad.net |
Commit message
Replaces use of official_answers and official_blueprints with their usage enum equivalents.
Description of the change
= Summary =
Replaces, where possible, usage of official_blueprints and official_answers with their usage enum equivalents.
== Proposed fix ==
Where code uses one of the above mentioned bools, use the enum instead so that we can take advantage of richer data.
== Pre-implementation notes ==
Spoke with Curtis Hovey (sinzui) and Brad Crittenden (bac).
== Implementation details ==
As in Proposed fix.
SQL queries using the official_<app> booleans have been left alone until data migration occurs.
== Tests ==
No new tests written.
To fully test the refactor:
bin/test -m lp.registry
bin/test -m lp.answers
bin/test -m lp.blueprints
== Demo and Q/A ==
In Launchpad.dev, there should be no apparent changes to any views related to answers or blueprints.
== Launchpad lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
j.c.sackett (jcsackett) wrote : | # |
> 37 + >>> ubuntu.
> 38 + 'LAUNCHPAD'
> 39 + >>> firefox.
> 40 + 'LAUNCHPAD'
>
> I'd rather you print these than just getting the value.
I was debating this myself prior to the review. This (and other instances) are fixed.
> 367 + >>> print view.blueprints
> 368 + 'LAUNCHPAD'
>
> Hm, how does this work? If you're printing the value here, why are you still getting quotes?
It doesn't work. I believe that was a casualty of my wavering on how to go about setting up those tests. It too has been resolved.
> Thanks for updating the doctests. One more doctest up to date.
Happy to do it.
//j.c.sackett
Paul Hummer (rockstar) : | # |
Preview Diff
1 | === modified file 'lib/lp/answers/browser/questiontarget.py' | |||
2 | --- lib/lp/answers/browser/questiontarget.py 2010-08-31 11:31:04 +0000 | |||
3 | +++ lib/lp/answers/browser/questiontarget.py 2010-09-10 13:32:47 +0000 | |||
4 | @@ -78,6 +78,7 @@ | |||
5 | 78 | IQuestionTarget, | 78 | IQuestionTarget, |
6 | 79 | ISearchQuestionsForm, | 79 | ISearchQuestionsForm, |
7 | 80 | ) | 80 | ) |
8 | 81 | from lp.app.enums import service_uses_launchpad | ||
9 | 81 | from lp.app.errors import NotFoundError | 82 | from lp.app.errors import NotFoundError |
10 | 82 | from lp.registry.interfaces.distribution import IDistribution | 83 | from lp.registry.interfaces.distribution import IDistribution |
11 | 83 | from lp.registry.interfaces.product import IProduct | 84 | from lp.registry.interfaces.product import IProduct |
12 | @@ -204,7 +205,7 @@ | |||
13 | 204 | return self.default_template | 205 | return self.default_template |
14 | 205 | involvement = getMultiAdapter( | 206 | involvement = getMultiAdapter( |
15 | 206 | (self.context, self.request), name='+get-involved') | 207 | (self.context, self.request), name='+get-involved') |
17 | 207 | if involvement.official_answers: | 208 | if service_uses_launchpad(involvement.answers_usage): |
18 | 208 | # Primary contexts that officially use answers have a | 209 | # Primary contexts that officially use answers have a |
19 | 209 | # search and listing presentation. | 210 | # search and listing presentation. |
20 | 210 | return self.default_template | 211 | return self.default_template |
21 | 211 | 212 | ||
22 | === modified file 'lib/lp/answers/doc/question.txt' | |||
23 | --- lib/lp/answers/doc/question.txt 2010-07-28 16:56:05 +0000 | |||
24 | +++ lib/lp/answers/doc/question.txt 2010-09-10 13:32:47 +0000 | |||
25 | @@ -72,13 +72,13 @@ | |||
26 | 72 | ============== | 72 | ============== |
27 | 73 | 73 | ||
28 | 74 | A product or distribution may be officially supported by the community using | 74 | A product or distribution may be officially supported by the community using |
30 | 75 | the Answer Tracker. This status is set by the official_answers attribute on | 75 | the Answer Tracker. This status is set by the answers_usage attribute on |
31 | 76 | the IProduct and IDistribution. | 76 | the IProduct and IDistribution. |
32 | 77 | 77 | ||
37 | 78 | >>> ubuntu.official_answers | 78 | >>> print ubuntu.answers_usage.name |
38 | 79 | True | 79 | LAUNCHPAD |
39 | 80 | >>> firefox.official_answers | 80 | >>> print firefox.answers_usage.name |
40 | 81 | True | 81 | LAUNCHPAD |
41 | 82 | 82 | ||
42 | 83 | 83 | ||
43 | 84 | IQuestion interface | 84 | IQuestion interface |
44 | 85 | 85 | ||
45 | === modified file 'lib/lp/answers/doc/questionsets.txt' | |||
46 | --- lib/lp/answers/doc/questionsets.txt 2010-07-27 17:18:24 +0000 | |||
47 | +++ lib/lp/answers/doc/questionsets.txt 2010-09-10 13:32:47 +0000 | |||
48 | @@ -208,14 +208,14 @@ | |||
49 | 208 | order of the returned projects is based on the number of questions asked | 208 | order of the returned projects is based on the number of questions asked |
50 | 209 | during the period. | 209 | during the period. |
51 | 210 | 210 | ||
60 | 211 | >>> ubuntu.official_answers | 211 | >>> print ubuntu.answers_usage.name |
61 | 212 | True | 212 | LAUNCHPAD |
62 | 213 | >>> firefox.official_answers | 213 | >>> print firefox.answers_usage.name |
63 | 214 | True | 214 | LAUNCHPAD |
64 | 215 | >>> landscape.official_answers | 215 | >>> print landscape.answers_usage.name |
65 | 216 | False | 216 | UNKNOWN |
66 | 217 | >>> launchpad.official_answers | 217 | >>> print launchpad.answers_usage.name |
67 | 218 | True | 218 | LAUNCHPAD |
68 | 219 | 219 | ||
69 | 220 | # Launchpad is not returned because the question was not asked in | 220 | # Launchpad is not returned because the question was not asked in |
70 | 221 | # the last 60 days. | 221 | # the last 60 days. |
71 | 222 | 222 | ||
72 | === modified file 'lib/lp/registry/browser/distribution.py' | |||
73 | --- lib/lp/registry/browser/distribution.py 2010-09-03 13:29:58 +0000 | |||
74 | +++ lib/lp/registry/browser/distribution.py 2010-09-10 13:32:47 +0000 | |||
75 | @@ -123,10 +123,10 @@ | |||
76 | 123 | """Return a string of LP apps (comma-separated) this distro uses.""" | 123 | """Return a string of LP apps (comma-separated) this distro uses.""" |
77 | 124 | uses = [] | 124 | uses = [] |
78 | 125 | href_template = """<a href="%s">%s</a>""" | 125 | href_template = """<a href="%s">%s</a>""" |
80 | 126 | if self.context.official_answers: | 126 | if service_uses_launchpad(self.context.answers_usage): |
81 | 127 | url = canonical_url(self.context, rootsite='answers') | 127 | url = canonical_url(self.context, rootsite='answers') |
82 | 128 | uses.append(href_template % (url, 'Answers')) | 128 | uses.append(href_template % (url, 'Answers')) |
84 | 129 | if self.context.official_blueprints: | 129 | if service_uses_launchpad(self.context.blueprints_usage): |
85 | 130 | url = canonical_url(self.context, rootsite='blueprints') | 130 | url = canonical_url(self.context, rootsite='blueprints') |
86 | 131 | uses.append(href_template % (url, 'Blueprints')) | 131 | uses.append(href_template % (url, 'Blueprints')) |
87 | 132 | if self.context.official_malone: | 132 | if self.context.official_malone: |
88 | 133 | 133 | ||
89 | === modified file 'lib/lp/registry/browser/pillar.py' | |||
90 | --- lib/lp/registry/browser/pillar.py 2010-09-03 13:29:58 +0000 | |||
91 | +++ lib/lp/registry/browser/pillar.py 2010-09-10 13:32:47 +0000 | |||
92 | @@ -70,7 +70,7 @@ | |||
93 | 70 | def ask_question(self): | 70 | def ask_question(self): |
94 | 71 | return Link( | 71 | return Link( |
95 | 72 | '+addquestion', 'Ask a question', site='answers', icon='answers', | 72 | '+addquestion', 'Ask a question', site='answers', icon='answers', |
97 | 73 | enabled=self.pillar.official_answers) | 73 | enabled=service_uses_launchpad(self.pillar.answers_usage)) |
98 | 74 | 74 | ||
99 | 75 | def help_translate(self): | 75 | def help_translate(self): |
100 | 76 | return Link( | 76 | return Link( |
101 | @@ -91,8 +91,11 @@ | |||
102 | 91 | 91 | ||
103 | 92 | def register_blueprint(self): | 92 | def register_blueprint(self): |
104 | 93 | return Link( | 93 | return Link( |
107 | 94 | '+addspec', 'Register a blueprint', site='blueprints', | 94 | '+addspec', |
108 | 95 | icon='blueprints', enabled=self.pillar.official_blueprints) | 95 | 'Register a blueprint', |
109 | 96 | site='blueprints', | ||
110 | 97 | icon='blueprints', | ||
111 | 98 | enabled=service_uses_launchpad(self.pillar.blueprints_usage)) | ||
112 | 96 | 99 | ||
113 | 97 | 100 | ||
114 | 98 | class PillarView(LaunchpadView): | 101 | class PillarView(LaunchpadView): |
115 | @@ -105,8 +108,8 @@ | |||
116 | 105 | def __init__(self, context, request): | 108 | def __init__(self, context, request): |
117 | 106 | super(PillarView, self).__init__(context, request) | 109 | super(PillarView, self).__init__(context, request) |
118 | 107 | self.official_malone = False | 110 | self.official_malone = False |
121 | 108 | self.official_answers = False | 111 | self.answers_usage = ServiceUsage.UNKNOWN |
122 | 109 | self.official_blueprints = False | 112 | self.blueprints_usage = ServiceUsage.UNKNOWN |
123 | 110 | self.translations_usage = ServiceUsage.UNKNOWN | 113 | self.translations_usage = ServiceUsage.UNKNOWN |
124 | 111 | self.codehosting_usage = ServiceUsage.UNKNOWN | 114 | self.codehosting_usage = ServiceUsage.UNKNOWN |
125 | 112 | pillar = nearest(self.context, IPillar) | 115 | pillar = nearest(self.context, IPillar) |
126 | @@ -119,11 +122,11 @@ | |||
127 | 119 | else: | 122 | else: |
128 | 120 | self._set_official_launchpad(pillar) | 123 | self._set_official_launchpad(pillar) |
129 | 121 | if IDistroSeries.providedBy(self.context): | 124 | if IDistroSeries.providedBy(self.context): |
130 | 122 | self.official_answers = False | ||
131 | 123 | distribution = self.context.distribution | 125 | distribution = self.context.distribution |
132 | 124 | self.codehosting_usage = distribution.codehosting_usage | 126 | self.codehosting_usage = distribution.codehosting_usage |
133 | 127 | self.answers_usage = ServiceUsage.NOT_APPLICABLE | ||
134 | 125 | elif IDistributionSourcePackage.providedBy(self.context): | 128 | elif IDistributionSourcePackage.providedBy(self.context): |
136 | 126 | self.official_blueprints = False | 129 | self.blueprints_usage = ServiceUsage.UNKNOWN |
137 | 127 | self.translations_usage = ServiceUsage.UNKNOWN | 130 | self.translations_usage = ServiceUsage.UNKNOWN |
138 | 128 | else: | 131 | else: |
139 | 129 | # The context is used by all apps. | 132 | # The context is used by all apps. |
140 | @@ -135,19 +138,21 @@ | |||
141 | 135 | # times to build the complete set of official applications. | 138 | # times to build the complete set of official applications. |
142 | 136 | if pillar.official_malone: | 139 | if pillar.official_malone: |
143 | 137 | self.official_malone = True | 140 | self.official_malone = True |
150 | 138 | if pillar.official_answers: | 141 | if service_uses_launchpad(IServiceUsage(pillar).answers_usage): |
151 | 139 | self.official_answers = True | 142 | self.answers_usage = ServiceUsage.LAUNCHPAD |
152 | 140 | if pillar.official_blueprints: | 143 | if service_uses_launchpad(IServiceUsage(pillar).blueprints_usage): |
153 | 141 | self.official_blueprints = True | 144 | self.blueprints_usage = ServiceUsage.LAUNCHPAD |
154 | 142 | self.translations_usage = IServiceUsage(pillar).translations_usage | 145 | if service_uses_launchpad(pillar.translations_usage): |
155 | 143 | self.codehosting_usage = IServiceUsage(pillar).codehosting_usage | 146 | self.translations_usage = ServiceUsage.LAUNCHPAD |
156 | 147 | if service_uses_launchpad(IServiceUsage(pillar).codehosting_usage): | ||
157 | 148 | self.codehosting_usage = ServiceUsage.LAUNCHPAD | ||
158 | 144 | 149 | ||
159 | 145 | @property | 150 | @property |
160 | 146 | def has_involvement(self): | 151 | def has_involvement(self): |
161 | 147 | """This `IPillar` uses Launchpad.""" | 152 | """This `IPillar` uses Launchpad.""" |
165 | 148 | return ( | 153 | return (self.official_malone |
166 | 149 | self.official_malone or self.official_answers | 154 | or service_uses_launchpad(self.answers_usage) |
167 | 150 | or self.official_blueprints | 155 | or service_uses_launchpad(self.blueprints_usage) |
168 | 151 | or service_uses_launchpad(self.translations_usage) | 156 | or service_uses_launchpad(self.translations_usage) |
169 | 152 | or service_uses_launchpad(self.codehosting_usage)) | 157 | or service_uses_launchpad(self.codehosting_usage)) |
170 | 153 | 158 | ||
171 | 154 | 159 | ||
172 | === modified file 'lib/lp/registry/browser/productseries.py' | |||
173 | --- lib/lp/registry/browser/productseries.py 2010-09-03 15:02:39 +0000 | |||
174 | +++ lib/lp/registry/browser/productseries.py 2010-09-10 13:32:47 +0000 | |||
175 | @@ -254,11 +254,11 @@ | |||
176 | 254 | 254 | ||
177 | 255 | def __init__(self, context, request): | 255 | def __init__(self, context, request): |
178 | 256 | super(ProductSeriesInvolvementView, self).__init__(context, request) | 256 | super(ProductSeriesInvolvementView, self).__init__(context, request) |
179 | 257 | self.answers_usage = ServiceUsage.NOT_APPLICABLE | ||
180 | 257 | if self.context.branch is not None: | 258 | if self.context.branch is not None: |
181 | 258 | self.codehosting_usage = ServiceUsage.LAUNCHPAD | 259 | self.codehosting_usage = ServiceUsage.LAUNCHPAD |
182 | 259 | else: | 260 | else: |
183 | 260 | self.codehosting_usage = ServiceUsage.UNKNOWN | 261 | self.codehosting_usage = ServiceUsage.UNKNOWN |
184 | 261 | self.official_answers = False | ||
185 | 262 | 262 | ||
186 | 263 | @property | 263 | @property |
187 | 264 | def configuration_links(self): | 264 | def configuration_links(self): |
188 | 265 | 265 | ||
189 | === modified file 'lib/lp/registry/browser/tests/distribution-views.txt' | |||
190 | --- lib/lp/registry/browser/tests/distribution-views.txt 2010-08-30 18:26:19 +0000 | |||
191 | +++ lib/lp/registry/browser/tests/distribution-views.txt 2010-09-10 13:32:47 +0000 | |||
192 | @@ -274,11 +274,12 @@ | |||
193 | 274 | If the distribution officially uses the application, its portlet does appear. | 274 | If the distribution officially uses the application, its portlet does appear. |
194 | 275 | 275 | ||
195 | 276 | >>> from canonical.testing.layers import MemcachedLayer | 276 | >>> from canonical.testing.layers import MemcachedLayer |
196 | 277 | >>> from lp.app.enums import ServiceUsage | ||
197 | 277 | 278 | ||
198 | 278 | # When the cache regenerated, all users will see the change. | 279 | # When the cache regenerated, all users will see the change. |
199 | 279 | >>> MemcachedLayer.purge() | 280 | >>> MemcachedLayer.purge() |
202 | 280 | >>> distribution.official_answers = True | 281 | >>> distribution.answers_usage = ServiceUsage.LAUNCHPAD |
203 | 281 | >>> distribution.official_blueprints = True | 282 | >>> distribution.blueprints_usage = ServiceUsage.LAUNCHPAD |
204 | 282 | >>> distribution.official_malone = True | 283 | >>> distribution.official_malone = True |
205 | 283 | 284 | ||
206 | 284 | >>> view = create_view(distribution, name='+index', principal=owner) | 285 | >>> view = create_view(distribution, name='+index', principal=owner) |
207 | 285 | 286 | ||
208 | === modified file 'lib/lp/registry/browser/tests/pillar-views.txt' | |||
209 | --- lib/lp/registry/browser/tests/pillar-views.txt 2010-09-01 22:59:30 +0000 | |||
210 | +++ lib/lp/registry/browser/tests/pillar-views.txt 2010-09-10 13:32:47 +0000 | |||
211 | @@ -24,7 +24,8 @@ | |||
212 | 24 | 24 | ||
213 | 25 | Pillars that do use launchpad applications have an involvement menu. | 25 | Pillars that do use launchpad applications have an involvement menu. |
214 | 26 | 26 | ||
216 | 27 | >>> distribution.official_answers = True | 27 | >>> from lp.app.enums import ServiceUsage |
217 | 28 | >>> distribution.answers_usage = ServiceUsage.LAUNCHPAD | ||
218 | 28 | >>> distribution.official_malone = True | 29 | >>> distribution.official_malone = True |
219 | 29 | >>> view = create_view( | 30 | >>> view = create_view( |
220 | 30 | ... distribution, '+get-involved', principal=distribution.owner) | 31 | ... distribution, '+get-involved', principal=distribution.owner) |
221 | @@ -33,14 +34,14 @@ | |||
222 | 33 | 34 | ||
223 | 34 | >>> view.official_malone | 35 | >>> view.official_malone |
224 | 35 | True | 36 | True |
227 | 36 | >>> view.official_answers | 37 | >>> print view.answers_usage.name |
228 | 37 | True | 38 | LAUNCHPAD |
229 | 38 | >>> view.translations_usage.name | 39 | >>> view.translations_usage.name |
230 | 39 | 'UNKNOWN' | 40 | 'UNKNOWN' |
235 | 40 | >>> view.official_blueprints | 41 | >>> print view.blueprints_usage.name |
236 | 41 | False | 42 | UNKNOWN |
237 | 42 | >>> view.codehosting_usage.name | 43 | >>> print view.codehosting_usage.name |
238 | 43 | 'NOT_APPLICABLE' | 44 | UNKNOWN |
239 | 44 | 45 | ||
240 | 45 | The view provides a list of enabled links that is rendered by the template. | 46 | The view provides a list of enabled links that is rendered by the template. |
241 | 46 | 47 | ||
242 | @@ -65,10 +66,10 @@ | |||
243 | 65 | 66 | ||
244 | 66 | >>> product = factory.makeProduct(name='bread') | 67 | >>> product = factory.makeProduct(name='bread') |
245 | 67 | >>> login_person(product.owner) | 68 | >>> login_person(product.owner) |
247 | 68 | >>> product.official_blueprints = True | 69 | >>> product.blueprints_usage = ServiceUsage.LAUNCHPAD |
248 | 69 | >>> view = create_view(product, '+get-involved') | 70 | >>> view = create_view(product, '+get-involved') |
251 | 70 | >>> view.official_blueprints | 71 | >>> print view.blueprints_usage.name |
252 | 71 | True | 72 | LAUNCHPAD |
253 | 72 | >>> for link in view.enabled_links: | 73 | >>> for link in view.enabled_links: |
254 | 73 | ... print link.name | 74 | ... print link.name |
255 | 74 | register_blueprint | 75 | register_blueprint |
256 | @@ -114,7 +115,6 @@ | |||
257 | 114 | 115 | ||
258 | 115 | Changing the product's usage is reflected in the view properties. | 116 | Changing the product's usage is reflected in the view properties. |
259 | 116 | 117 | ||
260 | 117 | >>> from lp.app.enums import ServiceUsage | ||
261 | 118 | >>> product.translations_usage = ServiceUsage.LAUNCHPAD | 118 | >>> product.translations_usage = ServiceUsage.LAUNCHPAD |
262 | 119 | >>> view = create_view(product, '+get-involved') | 119 | >>> view = create_view(product, '+get-involved') |
263 | 120 | >>> for key in sorted(view.configuration_states.keys()): | 120 | >>> for key in sorted(view.configuration_states.keys()): |
264 | @@ -189,8 +189,8 @@ | |||
265 | 189 | >>> product.project = project_group | 189 | >>> product.project = project_group |
266 | 190 | 190 | ||
267 | 191 | >>> view = create_view(project_group, '+get-involved') | 191 | >>> view = create_view(project_group, '+get-involved') |
270 | 192 | >>> view.official_blueprints | 192 | >>> print view.blueprints_usage.name |
271 | 193 | True | 193 | LAUNCHPAD |
272 | 194 | 194 | ||
273 | 195 | The offical_codehosting for a project is based on whether the project's | 195 | The offical_codehosting for a project is based on whether the project's |
274 | 196 | development focus series has a branch. | 196 | development focus series has a branch. |
275 | @@ -200,23 +200,23 @@ | |||
276 | 200 | >>> product.official_codehosting | 200 | >>> product.official_codehosting |
277 | 201 | False | 201 | False |
278 | 202 | >>> view = create_view(product, '+get-involved') | 202 | >>> view = create_view(product, '+get-involved') |
281 | 203 | >>> view.codehosting_usage.name | 203 | >>> print view.codehosting_usage.name |
282 | 204 | 'UNKNOWN' | 204 | UNKNOWN |
283 | 205 | 205 | ||
284 | 206 | >>> product.development_focus.branch = factory.makeBranch( | 206 | >>> product.development_focus.branch = factory.makeBranch( |
285 | 207 | ... product=product) | 207 | ... product=product) |
286 | 208 | >>> product.official_codehosting | 208 | >>> product.official_codehosting |
287 | 209 | True | 209 | True |
288 | 210 | >>> view = create_view(product, '+get-involved') | 210 | >>> view = create_view(product, '+get-involved') |
291 | 211 | >>> view.codehosting_usage.name | 211 | >>> print view.codehosting_usage.name |
292 | 212 | 'LAUNCHPAD' | 212 | LAUNCHPAD |
293 | 213 | 213 | ||
294 | 214 | Project groups cannot make links to register a branch, so | 214 | Project groups cannot make links to register a branch, so |
295 | 215 | official_codehosting is always false. | 215 | official_codehosting is always false. |
296 | 216 | 216 | ||
297 | 217 | >>> view = create_view(project_group, '+get-involved') | 217 | >>> view = create_view(project_group, '+get-involved') |
300 | 218 | >>> view.codehosting_usage.name | 218 | >>> print view.codehosting_usage.name |
301 | 219 | 'NOT_APPLICABLE' | 219 | NOT_APPLICABLE |
302 | 220 | 220 | ||
303 | 221 | DistroSeries can use this view. The distribution is used to set the links. | 221 | DistroSeries can use this view. The distribution is used to set the links. |
304 | 222 | 222 | ||
305 | @@ -232,7 +232,7 @@ | |||
306 | 232 | 232 | ||
307 | 233 | >>> from lp.app.enums import ServiceUsage | 233 | >>> from lp.app.enums import ServiceUsage |
308 | 234 | >>> login_person(distribution.owner) | 234 | >>> login_person(distribution.owner) |
310 | 235 | >>> distribution.official_blueprints = True | 235 | >>> distribution.blueprints_usage = ServiceUsage.LAUNCHPAD |
311 | 236 | >>> distribution.translations_usage = ServiceUsage.LAUNCHPAD | 236 | >>> distribution.translations_usage = ServiceUsage.LAUNCHPAD |
312 | 237 | >>> package = factory.makeDistributionSourcePackage( | 237 | >>> package = factory.makeDistributionSourcePackage( |
313 | 238 | ... sourcepackagename="box", | 238 | ... sourcepackagename="box", |
314 | 239 | 239 | ||
315 | === modified file 'lib/lp/registry/browser/tests/product-views.txt' | |||
316 | --- lib/lp/registry/browser/tests/product-views.txt 2010-08-16 19:28:37 +0000 | |||
317 | +++ lib/lp/registry/browser/tests/product-views.txt 2010-09-10 13:32:47 +0000 | |||
318 | @@ -482,8 +482,9 @@ | |||
319 | 482 | The portlet are rendered when a product officially uses the Launchpad | 482 | The portlet are rendered when a product officially uses the Launchpad |
320 | 483 | Answers, Blueprints, and Bugs applications. | 483 | Answers, Blueprints, and Bugs applications. |
321 | 484 | 484 | ||
324 | 485 | >>> product.official_answers = True | 485 | >>> from lp.app.enums import ServiceUsage |
325 | 486 | >>> product.official_blueprints = True | 486 | >>> product.answers_usage = ServiceUsage.LAUNCHPAD |
326 | 487 | >>> product.blueprints_usage = ServiceUsage.LAUNCHPAD | ||
327 | 487 | >>> product.official_malone = True | 488 | >>> product.official_malone = True |
328 | 488 | 489 | ||
329 | 489 | >>> view = create_initialized_view( | 490 | >>> view = create_initialized_view( |
330 | 490 | 491 | ||
331 | === modified file 'lib/lp/registry/browser/tests/productseries-views.txt' | |||
332 | --- lib/lp/registry/browser/tests/productseries-views.txt 2010-09-09 15:26:11 +0000 | |||
333 | +++ lib/lp/registry/browser/tests/productseries-views.txt 2010-09-10 13:32:47 +0000 | |||
334 | @@ -25,17 +25,17 @@ | |||
335 | 25 | 25 | ||
336 | 26 | >>> from lp.app.enums import ServiceUsage | 26 | >>> from lp.app.enums import ServiceUsage |
337 | 27 | >>> login_person(product.owner) | 27 | >>> login_person(product.owner) |
340 | 28 | >>> product.official_answers = True | 28 | >>> product.answers_usage = ServiceUsage.LAUNCHPAD |
341 | 29 | >>> product.official_blueprints = True | 29 | >>> product.blueprints_usage = ServiceUsage.LAUNCHPAD |
342 | 30 | >>> product.official_malone = True | 30 | >>> product.official_malone = True |
343 | 31 | >>> product.translations_usage = ServiceUsage.LAUNCHPAD | 31 | >>> product.translations_usage = ServiceUsage.LAUNCHPAD |
344 | 32 | >>> view = create_view(series, '+get-involved') | 32 | >>> view = create_view(series, '+get-involved') |
345 | 33 | 33 | ||
351 | 34 | # official_answers is always false for product series. | 34 | # answers_usage is never LAUNCHPAD for product series. |
352 | 35 | >>> print view.official_answers | 35 | >>> print view.answers_usage.name |
353 | 36 | False | 36 | NOT_APPLICABLE |
354 | 37 | >>> print view.official_blueprints | 37 | >>> print view.blueprints_usage.name |
355 | 38 | True | 38 | LAUNCHPAD |
356 | 39 | >>> print view.official_malone | 39 | >>> print view.official_malone |
357 | 40 | True | 40 | True |
358 | 41 | >>> print view.translations_usage.name | 41 | >>> print view.translations_usage.name |
359 | 42 | 42 | ||
360 | === modified file 'lib/lp/registry/browser/tests/projectgroup-views.txt' | |||
361 | --- lib/lp/registry/browser/tests/projectgroup-views.txt 2009-08-31 20:46:06 +0000 | |||
362 | +++ lib/lp/registry/browser/tests/projectgroup-views.txt 2010-09-10 13:32:47 +0000 | |||
363 | @@ -71,12 +71,14 @@ | |||
364 | 71 | The portlet are rendered when a child product officially uses the Launchpad | 71 | The portlet are rendered when a child product officially uses the Launchpad |
365 | 72 | Answers, Blueprints, and Bugs applications. | 72 | Answers, Blueprints, and Bugs applications. |
366 | 73 | 73 | ||
369 | 74 | >>> product.official_answers = True | 74 | >>> from lp.app.enums import ServiceUsage |
370 | 75 | >>> product.official_blueprints = True | 75 | >>> product.answers_usage = ServiceUsage.LAUNCHPAD |
371 | 76 | >>> product.blueprints_usage = ServiceUsage.LAUNCHPAD | ||
372 | 76 | >>> product.official_malone = True | 77 | >>> product.official_malone = True |
373 | 77 | 78 | ||
374 | 78 | >>> view = create_view(projectgroup, name='+index', principal=owner) | 79 | >>> view = create_view(projectgroup, name='+index', principal=owner) |
375 | 79 | >>> content = find_tag_by_id(view.render(), 'maincontent') | 80 | >>> content = find_tag_by_id(view.render(), 'maincontent') |
376 | 81 | |||
377 | 80 | >>> print find_tag_by_id(content, 'portlet-latest-faqs')['id'] | 82 | >>> print find_tag_by_id(content, 'portlet-latest-faqs')['id'] |
378 | 81 | portlet-latest-faqs | 83 | portlet-latest-faqs |
379 | 82 | >>> print find_tag_by_id(content, 'portlet-latest-questions')['id'] | 84 | >>> print find_tag_by_id(content, 'portlet-latest-questions')['id'] |
380 | 83 | 85 | ||
381 | === modified file 'lib/lp/registry/doc/distribution.txt' | |||
382 | --- lib/lp/registry/doc/distribution.txt 2010-08-31 23:03:45 +0000 | |||
383 | +++ lib/lp/registry/doc/distribution.txt 2010-09-10 13:32:47 +0000 | |||
384 | @@ -392,12 +392,12 @@ | |||
385 | 392 | >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 392 | >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
386 | 393 | >>> ubuntu.official_malone | 393 | >>> ubuntu.official_malone |
387 | 394 | True | 394 | True |
394 | 395 | >>> ubuntu.translations_usage.name | 395 | >>> print ubuntu.answers_usage.name |
395 | 396 | 'LAUNCHPAD' | 396 | LAUNCHPAD |
396 | 397 | >>> ubuntu.official_answers | 397 | >>> print ubuntu.blueprints_usage.name |
397 | 398 | True | 398 | LAUNCHPAD |
398 | 399 | >>> ubuntu.official_blueprints | 399 | >>> print ubuntu.translations_usage.name |
399 | 400 | True | 400 | LAUNCHPAD |
400 | 401 | 401 | ||
401 | 402 | The bug_tracking_usage property currently only tracks official_malone. | 402 | The bug_tracking_usage property currently only tracks official_malone. |
402 | 403 | 403 | ||
403 | @@ -462,11 +462,12 @@ | |||
404 | 462 | 462 | ||
405 | 463 | Launchpad admins and the distro owner can set these fields. | 463 | Launchpad admins and the distro owner can set these fields. |
406 | 464 | 464 | ||
407 | 465 | >>> from lp.app.enums import ServiceUsage | ||
408 | 465 | >>> login('mark@example.com') | 466 | >>> login('mark@example.com') |
409 | 466 | >>> debian = getUtility(ILaunchpadCelebrities).debian | 467 | >>> debian = getUtility(ILaunchpadCelebrities).debian |
413 | 467 | >>> debian.official_blueprints = True | 468 | >>> debian.blueprints_usage = ServiceUsage.LAUNCHPAD |
414 | 468 | >>> debian.official_blueprints | 469 | >>> print debian.blueprints_usage.name |
415 | 469 | True | 470 | LAUNCHPAD |
416 | 470 | >>> debian.official_malone = True | 471 | >>> debian.official_malone = True |
417 | 471 | >>> debian.official_malone | 472 | >>> debian.official_malone |
418 | 472 | True | 473 | True |
419 | @@ -477,16 +478,16 @@ | |||
420 | 477 | >>> debian_owner = factory.makePerson() | 478 | >>> debian_owner = factory.makePerson() |
421 | 478 | >>> debian.owner = debian_owner | 479 | >>> debian.owner = debian_owner |
422 | 479 | >>> login_person(debian_owner) | 480 | >>> login_person(debian_owner) |
426 | 480 | >>> debian.official_blueprints = False | 481 | >>> debian.blueprints_usage = ServiceUsage.NOT_APPLICABLE |
427 | 481 | >>> debian.official_blueprints | 482 | >>> print debian.blueprints_usage.name |
428 | 482 | False | 483 | NOT_APPLICABLE |
429 | 483 | 484 | ||
430 | 484 | But others can't. | 485 | But others can't. |
431 | 485 | 486 | ||
432 | 486 | >>> login('no-priv@canonical.com') | 487 | >>> login('no-priv@canonical.com') |
434 | 487 | >>> debian.official_blueprints = True | 488 | >>> debian.blueprints_usage = ServiceUsage.LAUNCHPAD |
435 | 488 | Traceback (most recent call last): | 489 | Traceback (most recent call last): |
437 | 489 | Unauthorized: (..., 'official_blueprints', 'launchpad.Edit') | 490 | Unauthorized: (..., 'blueprints_usage', 'launchpad.Edit') |
438 | 490 | >>> debian.official_malone = True | 491 | >>> debian.official_malone = True |
439 | 491 | Traceback (most recent call last): | 492 | Traceback (most recent call last): |
440 | 492 | Unauthorized: (..., 'official_malone', 'launchpad.Edit') | 493 | Unauthorized: (..., 'official_malone', 'launchpad.Edit') |
441 | 493 | 494 | ||
442 | === modified file 'lib/lp/registry/doc/product.txt' | |||
443 | --- lib/lp/registry/doc/product.txt 2010-09-03 13:29:58 +0000 | |||
444 | +++ lib/lp/registry/doc/product.txt 2010-09-10 13:32:47 +0000 | |||
445 | @@ -316,14 +316,13 @@ | |||
446 | 316 | Firefox uses the Answer Tracker as the official application to provide | 316 | Firefox uses the Answer Tracker as the official application to provide |
447 | 317 | answers to questions. | 317 | answers to questions. |
448 | 318 | 318 | ||
451 | 319 | >>> firefox.official_answers | 319 | >>> print firefox.answers_usage.name |
452 | 320 | True | 320 | LAUNCHPAD |
453 | 321 | 321 | ||
454 | 322 | Alsa does not use Launchpad to track answers. | 322 | Alsa does not use Launchpad to track answers. |
455 | 323 | 323 | ||
459 | 324 | >>> alsa.official_answers | 324 | >>> print alsa.answers_usage.name |
460 | 325 | False | 325 | UNKNOWN |
458 | 326 | |||
461 | 327 | 326 | ||
462 | 328 | Product Creation | 327 | Product Creation |
463 | 329 | ---------------- | 328 | ---------------- |
464 | @@ -383,17 +382,18 @@ | |||
465 | 383 | ---------------------- | 382 | ---------------------- |
466 | 384 | 383 | ||
467 | 385 | We should be able to set whether or not a Product uses specifications | 384 | We should be able to set whether or not a Product uses specifications |
469 | 386 | officially. It defaults to False. | 385 | officially. It defaults to UNKNOWN. |
470 | 387 | 386 | ||
471 | 388 | >>> firefox = productset.getByName('firefox') | 387 | >>> firefox = productset.getByName('firefox') |
480 | 389 | >>> firefox.official_blueprints | 388 | >>> print firefox.blueprints_usage.name |
481 | 390 | False | 389 | UNKNOWN |
482 | 391 | 390 | ||
483 | 392 | We can change it to True. | 391 | We can change it to use LAUNCHPAD. |
484 | 393 | 392 | ||
485 | 394 | >>> firefox.official_blueprints = True | 393 | >>> from lp.app.enums import ServiceUsage |
486 | 395 | >>> firefox.official_blueprints | 394 | >>> firefox.blueprints_usage = ServiceUsage.LAUNCHPAD |
487 | 396 | True | 395 | >>> print firefox.blueprints_usage.name |
488 | 396 | LAUNCHPAD | ||
489 | 397 | 397 | ||
490 | 398 | We should be able to get lists of specifications in different states | 398 | We should be able to get lists of specifications in different states |
491 | 399 | related to a product. | 399 | related to a product. |
492 | 400 | 400 | ||
493 | === modified file 'lib/lp/registry/templates/distribution-index.pt' | |||
494 | --- lib/lp/registry/templates/distribution-index.pt 2010-08-24 20:11:37 +0000 | |||
495 | +++ lib/lp/registry/templates/distribution-index.pt 2010-09-10 13:32:47 +0000 | |||
496 | @@ -52,7 +52,7 @@ | |||
497 | 52 | <div class="yui-g"> | 52 | <div class="yui-g"> |
498 | 53 | <div class="yui-u first"> | 53 | <div class="yui-u first"> |
499 | 54 | <div tal:replace="structure context/@@+portlet-listfaqs" | 54 | <div tal:replace="structure context/@@+portlet-listfaqs" |
501 | 55 | tal:condition="context/official_answers" /> | 55 | tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" /> |
502 | 56 | 56 | ||
503 | 57 | <div tal:replace="structure context/@@+portlet-latestbugs" | 57 | <div tal:replace="structure context/@@+portlet-latestbugs" |
504 | 58 | tal:condition="context/bug_tracking_usage/enumvalue:LAUNCHPAD" /> | 58 | tal:condition="context/bug_tracking_usage/enumvalue:LAUNCHPAD" /> |
505 | @@ -62,10 +62,10 @@ | |||
506 | 62 | 62 | ||
507 | 63 | <div class="yui-u"> | 63 | <div class="yui-u"> |
508 | 64 | <div tal:replace="structure context/@@+portlet-latestquestions" | 64 | <div tal:replace="structure context/@@+portlet-latestquestions" |
510 | 65 | tal:condition="context/official_answers" /> | 65 | tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" /> |
511 | 66 | 66 | ||
512 | 67 | <div tal:replace="structure context/@@+portlet-latestspecs" | 67 | <div tal:replace="structure context/@@+portlet-latestspecs" |
514 | 68 | tal:condition="context/official_blueprints" /> | 68 | tal:condition="context/blueprints_usage/enumvalue:LAUNCHPAD" /> |
515 | 69 | 69 | ||
516 | 70 | <div tal:replace="structure context/@@+portlet-coming-sprints" /> | 70 | <div tal:replace="structure context/@@+portlet-coming-sprints" /> |
517 | 71 | </div> | 71 | </div> |
518 | 72 | 72 | ||
519 | === modified file 'lib/lp/registry/templates/distribution-search.pt' | |||
520 | --- lib/lp/registry/templates/distribution-search.pt 2010-08-24 20:11:37 +0000 | |||
521 | +++ lib/lp/registry/templates/distribution-search.pt 2010-09-10 13:32:47 +0000 | |||
522 | @@ -77,7 +77,7 @@ | |||
523 | 77 | </a> | 77 | </a> |
524 | 78 | <a | 78 | <a |
525 | 79 | tal:define="link package/menu:answers/new" | 79 | tal:define="link package/menu:answers/new" |
527 | 80 | tal:condition="distribution/official_answers" | 80 | tal:condition="distribution/answers_usage/enumvalue:LAUNCHPAD" |
528 | 81 | tal:attributes="href link/url"> | 81 | tal:attributes="href link/url"> |
529 | 82 | <img | 82 | <img |
530 | 83 | tal:attributes="alt link/text" | 83 | tal:attributes="alt link/text" |
531 | @@ -137,7 +137,7 @@ | |||
532 | 137 | condition="binary_names" | 137 | condition="binary_names" |
533 | 138 | content="string:(Matching binaries: ${binary_names}.)"> | 138 | content="string:(Matching binaries: ${binary_names}.)"> |
534 | 139 | (Matching binaries: bin-one, bin-two.) | 139 | (Matching binaries: bin-one, bin-two.) |
536 | 140 | </tal:matching-binaries> | 140 | </tal:matching-binaries> |
537 | 141 | </tal:binary-search-only> | 141 | </tal:binary-search-only> |
538 | 142 | </p> | 142 | </p> |
539 | 143 | </div> | 143 | </div> |
540 | 144 | 144 | ||
541 | === modified file 'lib/lp/registry/templates/distroseries-index.pt' | |||
542 | --- lib/lp/registry/templates/distroseries-index.pt 2010-08-25 16:18:24 +0000 | |||
543 | +++ lib/lp/registry/templates/distroseries-index.pt 2010-09-10 13:32:47 +0000 | |||
544 | @@ -83,7 +83,8 @@ | |||
545 | 83 | 83 | ||
546 | 84 | <div | 84 | <div |
547 | 85 | tal:content="structure context/@@+portlet-latestspecs" | 85 | tal:content="structure context/@@+portlet-latestspecs" |
549 | 86 | tal:condition="context/@@+get-involved/official_blueprints" /> | 86 | tal:define="blueprints_usage context/@@+get-involved/blueprints_usage" |
550 | 87 | condition="blueprints_usage/enumvalue:LAUNCHPAD" /> | ||
551 | 87 | 88 | ||
552 | 88 | <div | 89 | <div |
553 | 89 | tal:replace="structure context/distribution/@@+portlet-coming-sprints" /> | 90 | tal:replace="structure context/distribution/@@+portlet-coming-sprints" /> |
554 | 90 | 91 | ||
555 | === modified file 'lib/lp/registry/templates/product-index.pt' | |||
556 | --- lib/lp/registry/templates/product-index.pt 2010-08-26 17:25:46 +0000 | |||
557 | +++ lib/lp/registry/templates/product-index.pt 2010-09-10 13:32:47 +0000 | |||
558 | @@ -215,7 +215,7 @@ | |||
559 | 215 | <div class="yui-g"> | 215 | <div class="yui-g"> |
560 | 216 | <div class="yui-u first"> | 216 | <div class="yui-u first"> |
561 | 217 | <div tal:content="structure context/@@+portlet-listfaqs" | 217 | <div tal:content="structure context/@@+portlet-listfaqs" |
563 | 218 | tal:condition="context/official_answers" /> | 218 | tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" /> |
564 | 219 | 219 | ||
565 | 220 | <div tal:content="structure context/@@+portlet-latestbugs" | 220 | <div tal:content="structure context/@@+portlet-latestbugs" |
566 | 221 | tal:condition="context/bug_tracking_usage/enumvalue:LAUNCHPAD" /> | 221 | tal:condition="context/bug_tracking_usage/enumvalue:LAUNCHPAD" /> |
567 | @@ -227,10 +227,10 @@ | |||
568 | 227 | 227 | ||
569 | 228 | <div class="yui-u"> | 228 | <div class="yui-u"> |
570 | 229 | <div tal:content="structure context/@@+portlet-latestquestions" | 229 | <div tal:content="structure context/@@+portlet-latestquestions" |
572 | 230 | tal:condition="context/official_answers" /> | 230 | tal:condition="context/answers_usage/enumvalue:LAUNCHPAD" /> |
573 | 231 | 231 | ||
574 | 232 | <div tal:content="structure context/@@+portlet-latestspecs" | 232 | <div tal:content="structure context/@@+portlet-latestspecs" |
576 | 233 | tal:condition="context/official_blueprints" /> | 233 | tal:condition="context/blueprints_usage/enumvalue:LAUNCHPAD" /> |
577 | 234 | 234 | ||
578 | 235 | <div tal:content="structure context/@@+portlet-coming-sprints" /> | 235 | <div tal:content="structure context/@@+portlet-coming-sprints" /> |
579 | 236 | </div> | 236 | </div> |
580 | 237 | 237 | ||
581 | === modified file 'lib/lp/registry/templates/productseries-index.pt' | |||
582 | --- lib/lp/registry/templates/productseries-index.pt 2010-08-25 15:24:48 +0000 | |||
583 | +++ lib/lp/registry/templates/productseries-index.pt 2010-09-10 13:32:47 +0000 | |||
584 | @@ -145,7 +145,7 @@ | |||
585 | 145 | <div class="yui-u"> | 145 | <div class="yui-u"> |
586 | 146 | <div | 146 | <div |
587 | 147 | tal:content="structure context/@@+portlet-latestspecs" | 147 | tal:content="structure context/@@+portlet-latestspecs" |
589 | 148 | tal:condition="context/@@+get-involved/official_blueprints" /> | 148 | tal:condition="context/@@+get-involved/blueprints_usage/enumvalue:LAUNCHPAD" /> |
590 | 149 | 149 | ||
591 | 150 | <div tal:replace="structure context/product/@@+portlet-coming-sprints" /> | 150 | <div tal:replace="structure context/product/@@+portlet-coming-sprints" /> |
592 | 151 | 151 | ||
593 | 152 | 152 | ||
594 | === modified file 'lib/lp/registry/templates/project-index.pt' | |||
595 | --- lib/lp/registry/templates/project-index.pt 2010-08-25 15:37:37 +0000 | |||
596 | +++ lib/lp/registry/templates/project-index.pt 2010-09-10 13:32:47 +0000 | |||
597 | @@ -72,11 +72,11 @@ | |||
598 | 72 | <tal:details replace="structure context/@@+details" /> | 72 | <tal:details replace="structure context/@@+details" /> |
599 | 73 | 73 | ||
600 | 74 | <tal:faqs content="structure context/@@+portlet-listfaqs" | 74 | <tal:faqs content="structure context/@@+portlet-listfaqs" |
602 | 75 | condition="context/@@+get-involved/official_answers" /> | 75 | condition="context/@@+get-involved/answers_usage/enumvalue:LAUNCHPAD" /> |
603 | 76 | 76 | ||
604 | 77 | <tal:has-many-project condition="view/has_many_projects"> | 77 | <tal:has-many-project condition="view/has_many_projects"> |
605 | 78 | <tal:questions content="structure context/@@+portlet-latestquestions" | 78 | <tal:questions content="structure context/@@+portlet-latestquestions" |
607 | 79 | condition="context/@@+get-involved/official_answers" /> | 79 | condition="context/@@+get-involved/answers_usage/enumvalue:LAUNCHPAD" /> |
608 | 80 | </tal:has-many-project> | 80 | </tal:has-many-project> |
609 | 81 | 81 | ||
610 | 82 | <tal:bugs content="structure context/@@+portlet-latestbugs" | 82 | <tal:bugs content="structure context/@@+portlet-latestbugs" |
611 | @@ -84,7 +84,7 @@ | |||
612 | 84 | 84 | ||
613 | 85 | <tal:has-many-project condition="view/has_many_projects"> | 85 | <tal:has-many-project condition="view/has_many_projects"> |
614 | 86 | <tal:specs content="structure context/@@+portlet-latestspecs" | 86 | <tal:specs content="structure context/@@+portlet-latestspecs" |
616 | 87 | condition="context/@@+get-involved/official_blueprints" /> | 87 | condition="context/@@+get-involved/blueprints_usage/enumvalue:LAUNCHPAD" /> |
617 | 88 | </tal:has-many-project> | 88 | </tal:has-many-project> |
618 | 89 | 89 | ||
619 | 90 | <tal:contributors content="structure context/@@+portlet-top-contributors"/> | 90 | <tal:contributors content="structure context/@@+portlet-top-contributors"/> |
620 | @@ -119,10 +119,10 @@ | |||
621 | 119 | 119 | ||
622 | 120 | <tal:has-few-project condition="not: view/has_many_projects"> | 120 | <tal:has-few-project condition="not: view/has_many_projects"> |
623 | 121 | <tal:questions content="structure context/@@+portlet-latestquestions" | 121 | <tal:questions content="structure context/@@+portlet-latestquestions" |
625 | 122 | condition="context/@@+get-involved/official_answers" /> | 122 | condition="context/@@+get-involved/answers_usage/enumvalue:LAUNCHPAD" /> |
626 | 123 | 123 | ||
627 | 124 | <tal:specs content="structure context/@@+portlet-latestspecs" | 124 | <tal:specs content="structure context/@@+portlet-latestspecs" |
629 | 125 | condition="context/@@+get-involved/official_blueprints" /> | 125 | condition="context/@@+get-involved/blueprints_usage/enumvalue:LAUNCHPAD" /> |
630 | 126 | 126 | ||
631 | 127 | <tal:sprints content="structure context/@@+portlet-coming-sprints" /> | 127 | <tal:sprints content="structure context/@@+portlet-coming-sprints" /> |
632 | 128 | </tal:has-few-project> | 128 | </tal:has-few-project> |
25 @@ -72,13 +72,13 @@ official_ answers official_ answers answers_ usage.name answers_ usage.name
26 ==============
27
28 A product or distribution may be officially supported by the community using
29 -the Answer Tracker. This status is set by the official_answers attribute on
30 +the Answer Tracker. This status is set by the answers_usage attribute on
31 the IProduct and IDistribution.
32
33 - >>> ubuntu.
34 - True
35 - >>> firefox.
36 - True
37 + >>> ubuntu.
38 + 'LAUNCHPAD'
39 + >>> firefox.
40 + 'LAUNCHPAD'
I'd rather you print these than just getting the value.
342 === modified file 'lib/lp/ registry/ browser/ tests/productse ries-views. txt' registry/ browser/ tests/productse ries-views. txt 2010-08-27 19:19:27 +0000 registry/ browser/ tests/productse ries-views. txt 2010-09-02 16:47:49 +0000 volvedMenu when product. owner) official_ answers = True official_ blueprints = True answers_ usage = ServiceUsage. LAUNCHPAD blueprints_ usage = ServiceUsage. LAUNCHPAD official_ malone = True official_ rosetta = True answers blueprints usage.name _usage. name
343 --- lib/lp/
344 +++ lib/lp/
345 @@ -23,18 +23,19 @@
346 The ProductSeries involvement view uses the ProductSeriesIn
347 rendering links:
348
349 + >>> from lp.app.enums import ServiceUsage
350 >>> login_person(
351 - >>> product.
352 - >>> product.
353 + >>> product.
354 + >>> product.
355 >>> product.
356 >>> product.
357 >>> view = create_view(series, '+get-involved')
358
359 - # official_answers is always false for product series.
360 - >>> print view.official_
361 - False
362 - >>> print view.official_
363 - True
364 + # answers_usage is never LAUNCHPAD for product series.
365 + >>> print view.answers_
366 + UNKNOWN
367 + >>> print view.blueprints
368 + 'LAUNCHPAD'
Hm, how does this work? If you're printing the value here, why are you still getting quotes?
So I think I'd rather you print all the values instead of getting them as strings, and I think you might need to run these tests to make sure you're getting the right values. I suspect in some case you're printing something and expecting the quoted value instead of the string.
Thanks for updating the doctests. One more doctest up to date.