Code review comment for lp:~jcsackett/launchpad/deprecate-remaining-official-bools

Revision history for this message
Paul Hummer (rockstar) wrote :

25 @@ -72,13 +72,13 @@
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.official_answers
34 - True
35 - >>> firefox.official_answers
36 - True
37 + >>> ubuntu.answers_usage.name
38 + 'LAUNCHPAD'
39 + >>> firefox.answers_usage.name
40 + 'LAUNCHPAD'

I'd rather you print these than just getting the value.

342 === modified file 'lib/lp/registry/browser/tests/productseries-views.txt'
343 --- lib/lp/registry/browser/tests/productseries-views.txt 2010-08-27 19:19:27 +0000
344 +++ lib/lp/registry/browser/tests/productseries-views.txt 2010-09-02 16:47:49 +0000
345 @@ -23,18 +23,19 @@
346 The ProductSeries involvement view uses the ProductSeriesInvolvedMenu when
347 rendering links:
348
349 + >>> from lp.app.enums import ServiceUsage
350 >>> login_person(product.owner)
351 - >>> product.official_answers = True
352 - >>> product.official_blueprints = True
353 + >>> product.answers_usage = ServiceUsage.LAUNCHPAD
354 + >>> product.blueprints_usage = ServiceUsage.LAUNCHPAD
355 >>> product.official_malone = True
356 >>> product.official_rosetta = True
357 >>> view = create_view(series, '+get-involved')
358
359 - # official_answers is always false for product series.
360 - >>> print view.official_answers
361 - False
362 - >>> print view.official_blueprints
363 - True
364 + # answers_usage is never LAUNCHPAD for product series.
365 + >>> print view.answers_usage.name
366 + UNKNOWN
367 + >>> print view.blueprints_usage.name
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.

review: Needs Information

« Back to merge proposal