~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/packaging-views.txt

  • Committer: Ian Booth
  • Date: 2011-04-19 15:10:57 UTC
  • mfrom: (12868 devel)
  • mto: This revision was merged to the branch mainline in revision 12983.
  • Revision ID: ian.booth@canonical.com-20110419151057-he56y6k29c4zeiyk
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
157
157
    >>> view.errors
158
158
    []
159
159
 
 
160
We now have two source packages linked to our productseries.
 
161
 
160
162
    >>> for packaging in view.ubuntu_history:
161
163
    ...     print packaging.distroseries.name
162
164
    ...     print packaging.sourcepackagename.name
163
165
    hoary thunderbird
 
166
    hoary hot
164
167
 
165
168
It is not an error to submit the same sourcepackagename information, the
166
169
action is ignored because there is no change
178
181
    ...     print packaging.distroseries.name
179
182
    ...     print packaging.sourcepackagename.name
180
183
    hoary thunderbird
 
184
    hoary hot
181
185
 
182
186
When the current Ubuntu series changes, the sourcepackagename is not known,
183
187
and a new entry can be added to the packaging history.
213
217
    ...     print packaging.sourcepackagename.name
214
218
    grumpy hot
215
219
    hoary thunderbird
 
220
    hoary hot
216
221
 
217
222
 
218
223
Product packages view
230
235
    ...     for series in view.series_batch.batch:
231
236
    ...         print series.name
232
237
    ...         for package in series.packagings:
233
 
    ...             print '  Package:', package.distroseries.name
 
238
    ...             print '  Package %s: %s' % (
 
239
    ...                 package.sourcepackagename.name,
 
240
    ...                 package.distroseries.name)
234
241
    >>> print_packages(view)
235
242
    trunk
236
243
    hotter
237
 
      Package: grumpy
238
 
      Package: hoary
 
244
      Package hot: grumpy
 
245
      Package thunderbird: hoary
 
246
      Package hot: hoary
239
247
    cold
240
248
 
241
249
The view provides the distro_packaging property that is a list of
254
262
    >>> [hoary_package] = [
255
263
    ...     package for series in view.series_batch.batch
256
264
    ...     for package in series.packagings
257
 
    ...     if package.distroseries.name == 'hoary']
 
265
    ...     if package.distroseries.name == 'hoary' and
 
266
    ...         package.sourcepackagename.name == 'thunderbird']
258
267
    >>> login_person(hoary_package.sourcepackage.currentrelease.maintainer)
259
268
    >>> view = create_initialized_view(
260
269
    ...     product, name='+packages',
262
271
    >>> print_packages(view)
263
272
    trunk
264
273
    hotter
265
 
      Package: grumpy
266
 
      Package: hoary
 
274
      Package hot: grumpy
 
275
      Package thunderbird: hoary
 
276
      Package hot: hoary
267
277
    cold
268
278
 
269
279
    # There are links to the +remove-packaging page.
285
295
    >>> print_packages(view)
286
296
    trunk
287
297
    hotter
288
 
      Package: grumpy
 
298
      Package hot: grumpy
 
299
      Package hot: hoary
289
300
    cold
290
301
 
291
302
 
319
330
    ...     print packaging.sourcepackagename.name
320
331
    netapplet
321
332
    evolution
 
333
    hot
322
334
 
323
335
 
324
336
Distro series +needs-packaging view
351
363
    cnews
352
364
    libstdc++
353
365
    linux-source-2.6.15
354
 
    hot
355
366
    thunderbird